[Math] Integration substitution: How does Wolfram Alpha come up with this step

analysisintegrationtrigonometrywolfram alpha

I have to integrate
$$
\int \frac{1}{(\sin x) (\cos x)} \, dx
$$

I looked at the Wolfram Alpha step by step solution to figure out how to do it.

First, it rewrites the integral as:
$$
\int (\csc x) (\sec x) \, dx
$$

This step I understand, but then it substitutes:

For the integrand $\csc x\cdot\sec x$, substitute $u=\tan(x)$ and $\mathrm{d}u=\sec^2(x)\mathrm{d}x$:
$$
\int \frac{1}{u} \, du
$$

My question is, how does it know to substitute $\tan x$ for $u$, and $\sec^2x$ for $\mathrm{d}x$? And how does that simplifies to $1/u~\mathrm{d}u$?

Best Answer

Rewrite it as: $$\frac 1{(\sin x)(\cos x)} = \frac 1 {\frac{\sin x}{\cos x}\cos^2x} = \frac 1 {\tan x \cdot \cos^2x} = \frac 1 {\tan x} \cdot \frac 1 {\cos^2x}$$

Now, since you know the derivative of the tangent, you substitute $u = \tan x$. You have that $\mathrm du = \frac 1 {\cos^2x} \mathrm dx$. I'm confident that you can continue from here.

Related Question