2

How to solve this integral?$$\int\frac{\sec^2(x)}{(4+\tan^2(x))^2}\, dx$$

I've tried the following:

Starting by substituting $\tan(x) = 2\tan(\theta)\implies \sec^2(x)\ dx= 2\sec^2(\theta)\ d\theta$

$$\implies\int\frac{2\sec^2(\theta)}{(4 + 4\tan^2\theta)^2}\ d\theta\\\implies\int\frac{2\sec^2(\theta)}{16 (\sec^2\theta)^2}\ d\theta\\\implies\int\frac{\cos^2(\theta)}{8} \ d\theta\\\implies\frac\theta{16} + \frac{\sin(2\theta)}{32}+ c$$

Now since, $\tan(x) = 2 \tan\theta\implies \arctan\left(\frac{\tan(x)}{2}\right) = \theta$

So, the final answer to the integral may be, $$\implies\frac{\arctan\left(\frac{\tan(x)}{2}\right)}{16} + \frac{\sin(2\arctan\left(\frac{\tan(x)}{2}\right))}{32}+ c$$

I checked the answer on wolfram Alpha and found that my answer is not matching with that.

Can anyone tell me what should I do to verify my answer?

  • 2
    You might want to add the tag [solution-verification] to your question. – soupless Jan 27 '22 at 16:07
  • 1
    You could have substitued $tan(x)=2tanθ$ directly.It would have directly taken you to the second last step. Apart from this,the solution seems fine to me. –  Jan 27 '22 at 16:08
  • 4
    To verify your answer, take its derivative. If your antiderivative is correct, then you should be able to recover the original integrand that way. – user170231 Jan 27 '22 at 16:29
  • 1
    I know a different method that you would like to know rather than this way – Mikasa Jan 27 '22 at 16:29
  • @Mikasa Yeah sure, May you please add your answer? –  Jan 27 '22 at 16:30
  • 1
    @Utkarsh The question you searched on wolfram alpha is different from the original quesion. –  Jan 27 '22 at 16:36
  • Yea, But it is still not matching. @RamanujanXV –  Jan 27 '22 at 16:37
  • 1
    Doesnt matter,You can use the method as stated by @user170231 . –  Jan 27 '22 at 16:41
  • 1
    You can graph both answers. If they are parallel, then you probably have the right solution. – B. Goddard Jan 27 '22 at 16:41
  • 1
    @SiriusBlack, you can verify your answer by differentiating (as user170231 says) and even have WA verify it for you. – Robert Lee Jan 27 '22 at 16:52
  • @RobertLee Yeah I checked it by plotting on GeoGebra. Thank you all guys. –  Jan 27 '22 at 16:52
  • "I got one antiderivative, but they got another" is a common point of confusion when trigonometry is involved, because trigonometric identities allow the same function to be written in ways that aren't obviously equal. To make matters worse, antiderivatives need only be equal up to an additive constant (well, locally constant function, but we're in enough trouble as it is). – J.G. Jan 27 '22 at 17:31

3 Answers3

1

If you want to check your answer, just differentiate and see if you get back the function you started from.

But there's a much simpler method. I'd simply observe that with the substitution $\tan x=2u$, the integral becomes $$ \frac{1}{8}\int\frac{1}{(1+u^2)^2}\,du $$ which is standard. Leaving aside the factor $1/8$, we can write $$ \int\frac{1+u^2-u^2}{(1+u^2)^2}\,du=\int\frac{1}{1+u^2}\,du+\frac{1}{2}\int u\frac{-2u}{(1+u)^2}\,du=\arctan u+\frac{1}{2}\frac{u}{1+u^2}-\frac{1}{2}\int\frac{1}{1+u^2}\,du $$ and therefore $$ \frac{1}{2}\arctan u+\frac{1}{2}\frac{u}{1+u^2}+c $$ Now reinsert the factor $1/8$ and do back substitution to get $$ \frac{1}{16}\Bigl(\arctan\Bigl(\frac{\tan x}{2}\Bigr)+\frac{2\tan x}{4+\tan^2x}\Bigr)+c $$

egreg
  • 238,574
1

You can use the noble method known as Ostrogradski method:

Assume you are at the step evaluating $\int\frac{1}{(1+u^2)^2}du$. According to this method, it

$$\int\frac{1}{(1+u^2)^2}du=\dfrac{au+b}{1+u^2}+\int\frac{cu+d}{1+u^2}du$$

Now apply the method to find the constants $a,b,c$ and $d$.

Mikasa
  • 67,374
0

Wolfram|Alpha returns an antiderivative of

$$\int \frac{\sec^2(x)}{\left(4+\tan^2(x)\right)^2} \, dx = \frac{2\sin(2x) - (3\cos(2x)+5) \arctan\left(2\cot(x)\right)}{48\cos(2x) + 80} + C$$

which we can rewrite as

$$-\frac1{16} \arctan\left(2\cot(x)\right) + \frac18 \cdot \frac{\sin(2x)}{3\cos(2x) + 5} + C$$


The antiderivative you found was

$$\int\frac{\sec^2(x)}{\left(4+\tan^2(x)\right)^2} \, dx = \frac1{16} \arctan\left(\frac12 \tan(x)\right) + \frac1{32} \sin\left(2\arctan\left(\frac12\tan(x)\right)\right) + C$$


We have

$$\arctan(x) + \arctan\left(\frac1x\right) = \begin{cases}\frac\pi2 & \text{if }x>0 \\ -\frac\pi2 & \text{if }x<0\end{cases}$$

If we take $2\cot(x)>0$, then

$$\begin{align} -\frac1{16} \arctan(2\cot(x)) + C &= -\frac1{16} \arctan(2\cot(x)) - \frac\pi2 + C \\ &= \frac1{16} \arctan\left(\frac1{2\cot(x)}\right) + C \\ &= \frac1{16} \arctan\left(\frac12\tan(x)\right) + C \end{align}$$

so that the first terms "match" (not identical, but they only differ by a constant). A similar conclusion is made by instead assuming $2\cot(x)<0$.

Since $\sin(2x) = 2\cos(x)\sin(x)$, the second term in your solution is

$$\frac1{16} \sin\left(\arctan\left(\frac12\tan(x)\right)\right) \cos\left(\arctan\left(\frac12\tan(x)\right)\right) = \frac18 \cdot \frac{\tan(x)}{4 + \tan^2(x)}$$

(Consider a right triangle with reference angle $\theta$ for which $\tan(\theta)=\frac12\tan(x)$, so the ratio of the legs opposite and adjacent to $\theta$ is $\tan(x)$ to $2$. It follows that this triangle's hypotenuse has length $\sqrt{4+\tan^2(x)}$.)

Now, we have

$$\begin{align} \frac18\cdot\frac{\tan(x)}{4+\tan^2(x)} &= \frac18 \cdot \frac{\sin(x)\cos(x)}{4\cos^2(x)+\sin^2(x)} \\ &= \frac18 \cdot \frac{\frac12 \sin(2x)}{3\cos^2(x) + 1} \\ &= \frac1{16} \cdot \frac{\sin(2x)}{\frac32(1+\cos(2x))+1} \\ &= \frac18 \cdot \frac{\sin(2x)}{5+3\cos(2x)} \end{align}$$

and so both solutions also have matching second terms.

user170231
  • 19,334