<s>[INST] Evaluate $\int \cos^2(x)\tan^3(x) dx$ using trigonometric substitution How would I integrate to evaluate $\int \cos^2(x)\tan^3(x) dx$ using trigonometric substitution?
I made an attempt by making substitutions such as $$\cos^2(x)=1-\sin^2(x)$$
$$\tan(x) = \frac{\sin(x)}{\cos(x)}$$ and $$\tan^2(x)=1+\sec^2(x)$$
But I couldn't find a way to make it look like an integral I could solve using a $u$ substitution or identity.
Could I get some help on this one?
 [/INST] Just for fun:
$$\int \cos^2 x \tan^3x  \ \mathrm{d} x$$
$$=\int \frac{\tan^3 x}{\sec^2 x} \ \mathrm{d} x$$
Now let $u = \tan^2 x, \mathrm du = 2 \tan x \sec^2 x \ \mathrm dx$:
$$=\int \frac{u \tan x }{\sec^2 x} \cdot \frac{\mathrm{d} u}{2 \tan x \sec^2 x}$$
$$=\frac{1}{2} \int \frac{u}{\sec^4 x} \mathrm d u$$
$$=\frac{1}{2} \int \frac{u}{(1+u)^2} \ \mathrm d u$$
$$=\frac{1}{2} \int \frac{1+u}{(1+u)^2} -\frac{1}{(1+u)^2} \mathrm d u$$
$$=\frac{1}{2} \left( \ln(\tan^2 x + 1) + \frac{1}{1+\tan^2 x} \right)  +C$$
$$=\frac{1}{2} \left( \ln | \sec^2 x| + \cos^2 x \right) + C$$
where we have used the identity $1 + \tan^2 x = \sec^2 x$ twice.
Further simplifying gives the accepted answer:
$$=\frac{1}{2} \left( \ln | \cos^{-2} x| + \cos^2 x \right) + C$$
$$=\frac{1}{2} \left(-2 \ln | \cos x | + \cos^2 x \right) + C$$
$$=\frac{\cos^2 x}{2} - \ln | \cos x | + C$$
</s>