# Trig substitution integral

I am trying to find $$\int{ \frac {5x + 1}{x^2 + 4} dx}$$ The best approach would be to split up the fraction. According to Wolfram Alpha, the answer is $\frac{5}{2}\ln\left(x^2 + 4\right) + \frac{1}{2}\displaystyle\arctan\left(\frac x2\right)$ which seems OK, but when I try the trig substitution: $x = 2\tan\theta$, I get an answer that is slightly different but not equivalent, and I've looked at this over and over and I couldn't quite figure out what I did wrong.

$$x = 2\tan\theta$$ $$dx = 2\sec^2\theta d\theta$$ $$\int{ \frac {5x + 1}{x^2 + 4}dx} = \frac{1}{4}\int{\frac{10\tan\theta + 1}{\sec^2\theta} 2\sec^2\theta \,d\theta}$$ $$= \frac{1}{2}\int{10 \tan\theta + 1}\space d\theta$$ $$= 5 \ln|\sec\theta| + \frac{\theta}{2} + C$$ We know $\theta = \displaystyle\arctan\left(\frac x2\right)$ and since $\tan\theta = \displaystyle\frac{x}{2}$, we can draw a triangle to see that $\sec\theta = \displaystyle\frac{\sqrt{x^2 + 4}}{2}$.

$$5 \ln|\sec\theta| + \frac{\theta}{2} = 5\ln\left({\frac{\sqrt{x^2 + 4}}{2}}\right) + \frac{1}{2}\arctan\left({\frac x2}\right)$$ $$= \frac{5}{2}\ln\left({\frac{x^2 + 4}{4}}\right) + \frac{1}{2}\arctan\left({\frac x2}\right)$$

But $$\frac{5}{2}\ln\left({\frac{x^2 + 4}{4}}\right) + \frac{1}{2}\arctan\left({\frac x2}\right) \neq \frac{5}{2}\ln\left(x^2 + 4\right) + \frac{1}{2}\arctan\left(\frac x2\right)$$

There seems to be a small difference between the answer provided by Alpha and the trig substitution method, but I cannot see where I made the mistake.

$$\frac{5}{2}\ln({\frac{x^2 + 4}{4}}) + \frac{1}{2}\arctan({x/2}) + c_1 \neq \frac{5}{2}\ln(x^2 + 4) + \frac{1}{2}\arctan(x/2) + C$$

Note that $$\frac{5}{2}\ln\left({\frac{x^2 + 4}{4}}\right) = \frac 52 \ln\left(x^2 + 4\right) - \frac 52 \left (\ln 4\right) = \frac 52 \ln(x^2 + 4) + c_2$$

So put $c_1 + c_2 = C$. Then the answers are equal. Solutions to an integral consist of a family of solutions $F(x) + C$, which differ only by a constant. That is, if $F(x) + C$ is the solution after computing an intregral, so is $F(x) + C_i$, for any constant $C_i \neq C$.

In short, you're both correct!

• Ah, I did not think of it like that. Looks like I did not make a mistake after all - thanks! – hesson Feb 22 '13 at 2:19
• You're welcome, hesson. This can often occur when you end with an integration including the $\ln$ function: often it can be reduced to $\ln$ function + a constant, as in this case. Also, various trig substitutions can work, and one may arrive at different solutions in terms of trig functions, where one can be converted to the other by applying trig identities. – Namaste Feb 22 '13 at 2:27

The first approach is easier in fact: $$I= \int \frac{(5x +1)dx}{x^2+4}=I_1 + I_2$$ where $$I_1 = \int\frac{5x dx}{x^2+4}\\ I_2 = \int \frac{dx}{x^2+4}$$ hence, $$I_1 = \frac{5}{2} \int \frac{2xdx}{x^2+4} = \frac{5}{2} \int \frac{d(x^2+4)} {x^2+4}=\frac{5}{2} \log( x^2 +4) +C_1$$ In fact you can see that the numerator is a derivative of the denominator. $$I_2 = \int \frac{dx}{x^2+ 2^2} = \frac{\arctan(\frac{x}{a})}{a} +C_2$$ This approach is more efficient as it does not require you to make any substitutions/

Since $$\frac52 \ln (\frac{x^2+4}{4})=\frac52 \ln(x^2+4)-\frac52 \ln 4,$$ the difference between the two answers is an additive constant, which can be absorbed into the constant of integration $C$.