# Integral - best way to solve

1. Aug 14, 2014

### etf

Here is my integral:
$$\\\int \frac{y}{((x-1)^{2}+y^{2})^{2}}dy$$
I solved it using substitution $$y=(x-1)\tan{\varphi }$$
Final result is $$\frac{1}{2(x-1)^{2}}\sin^{2}{(arctan(\frac{y}{x-1}))}$$
It was complicated to solve it and I used few trig. identities. My question is, is it possible to solve it using another method (faster)?

2. Aug 14, 2014

### LCKurtz

I would just call $(x-1)^2=a^2$ so you have $\int \frac y {(a^2+y^2)^2}~dy$ and let $u = a^2 +y^2$, $du = 2y~dy$. Your answer doesn't look even close to correct.

3. Aug 14, 2014

### Staff: Mentor

Well, $$\sin^2 (\arctan (z)) = \frac{z^2}{z^2+1}$$The answer is not correct, but it is not far away from the right answer (just expressed in a very complicated way).

4. Aug 14, 2014

### etf

I found derivative of my solution (using Matlab) and I got my original function Are you sure it's not correct?

5. Aug 14, 2014

### LCKurtz

Well, since you didn't show your work I didn't spend any time trying to verify it. Your method is certainly not the preferred method for this problem. Try the substitution I suggested and you will see.

6. Aug 14, 2014

### etf

I will post complete solution.

7. Aug 14, 2014

### Staff: Mentor

I don't get that. Note that I replaced x-1 by x as it always appears in this combination.

8. Aug 14, 2014

### etf

$$\int \frac{y}{((x-1)^{2}+y^{2})^{2}}dy=\left \{ y=(x-1)tan\varphi ,dy=\frac{x-1}{\cos^{2}{\varphi }}d\varphi \right \}=$$$$\\\int \frac{(x-1)tan\varphi }{((x-1)^{2}+(x-1)^{2}tan^{2}\varphi )^{2}}\frac{x-1}{\cos^{2}{\varphi }}d\varphi =$$$$\\\int \frac{(x-1)tan\varphi }{(x-1)^{4}(1+tan^{2}\varphi )^{2}}\frac{x-1}{\cos^{2}{\varphi }}d\varphi =$$$$\\\frac{1}{(x-1)^{2}}\int \frac{tan\varphi }{(sec^{2}\varphi )^{2}}\frac{1}{\cos^{2}{\varphi }}d\varphi =$$ $$\\=\frac{1}{(x-1)^{2}}\int \frac{\frac{\sin{\varphi }}{\cos{\varphi }}}{\frac{1}{\cos^{4}{\varphi }}\cos^{2}{\varphi }}d\varphi=\frac{1}{(x-1)^{2}}\int \sin{\varphi }cos{\varphi}d\varphi =\frac{1}{2(x-1)^{2}}\int \sin{2\varphi }d\varphi =\frac{1}{2(x-1)^{2}}\sin^{2}{\varphi }$$

Last edited: Aug 14, 2014
9. Aug 14, 2014

### etf

You forgot to raise sin at 2 ? If you put d/dy (1/(2x^2) * (sin(arctan(y/x)))^2) you will get correct result...
Here is my result from Matlab:
>> syms x y
>> f=(1/(2*(x-1)^2))*(sin(atan(y/(x-1))))^2;
>> simplify(diff(f,y)-y/((x-1)^2+y^2)^2)

ans =

0

Last edited: Aug 14, 2014
10. Aug 14, 2014

### LCKurtz

And the answer is yes. Have you tried what I suggested? It's much easier.

11. Aug 14, 2014

### etf

LCKurtz, I have done it using your substitution in only few lines. Definitely much better way to solve this integral :)

12. Aug 14, 2014

### etf

Can you tell me how did you come up with that equality?

13. Aug 14, 2014

### LCKurtz

Draw a picture of an angle whose tangent is $z$. What is that angle's sine?

14. Aug 14, 2014

### etf

Got it now:)

15. Aug 14, 2014

### Ray Vickson

If we set x-1 = a you have
$$\int \frac{y}{(a^2+y^2)^2} \, dy = \frac{1}{2a^2} \sin^2 \left( \arctan \left(\frac{y}{a} \right) \right)+C_1 \equiv \frac{1}{2a^2} \frac{y^2}{a^2+y^2}+C_1 \: \Longleftarrow \: F_1(y)$$
Doing the integral another way gives
$$\int \frac{y}{(a^2+y^2)^2} \, dy = -\frac{1}{2} \frac{1}{a^2+y^2} + C_2 \: \Longleftarrow \: F_2(y)$$

Although $F_1(y)$ and $F_2(y)$ look very different, it is wise to remember arbitrary constants of integration, so we have, in fact, that $F_1(y) - F_2(y) = \text{const.}$ Therefore, they are equivalent.

16. Aug 16, 2014

### Staff: Mentor

Oh, right.
Okay, looks fine.