Am I doing integration correctly? Wolfram alpha has a different answer

107 Views Asked by At

so im supposed to get the integral of $$ \int \frac{(1+\sec(x))^2 }{\sec(x)} $$

my solution is

$$= \int \frac{1 + 2\sec (x) + \sec^2(x)}{\sec(x)} dx$$

$$= \int \frac{dx}{\sec (x)} + \int 2\,dx + \int\sec(x) \, dx$$

$$= \int \cos(x)\,dx + \int 2\,dx + \int\sec(x)\,dx$$

$$= \sin(x) + 2x + \ln|\sec(x)+\tan(x)| + C $$

I don't understand why when I double check my answers using an integral solver it doesnt seem to add up

2

There are 2 best solutions below

0
On

your integrand is equivalent to $$\frac{1+\cos(x)^2+2\cos(x)}{\cos(x)}$$ use the substitution $$\cos(x)=\frac{1-t^2}{1+t^2}$$ and $$dx=\frac{2\,dt}{1+t^2}$$ this is the so called tan half substitution. your result $$\ln \left( \sec \left( x \right) +\tan \left( x \right) \right) +2\, x+\sin \left( x \right) $$ is right.

4
On

Wolfram alpha gives answer:

$$\sin(x)+2x+\log(\sin(x/2)+\cos(x/2))-\log(\sin(x/2)-\cos(x/2))$$

But:

$$\ln(\sec(x)+\tan(x))=\ln(\frac{1}{\cos(x)}+\frac{\sin(x)}{\cos(x)})=\\=\ln\left(\frac{1+\sin(x)}{\cos(x)}\right)=\ln\left(\frac{1+\sin(x)}{((\cos(x/2)-\sin(x/2))(\cos(x/2)+\sin(x/2))}\right)=\\=\ln\left(\frac{\sin(x/2)^2+\cos(x/2)^2+2\sin(x/2)\cos(x/2)}{((\cos(x/2)-\sin(x/2))(\cos(x/2)+\sin(x/2))}\right)=\\=\ln\left(\frac{\sin(x/2)+\cos(x/2)}{\cos(x/2)-\sin(x/2)}\right)=\\=\log(\sin(x/2)+\cos(x/2))-\log(\cos(x/2)-\sin(x/2))$$