# Interesting Integral

During my time at university, I was asked to solve an integral as part of one of my assignments. The integral was as follows:

$$\text{Integrate the following:}\\ \int \int \frac{x^2 -y^2}{(x^2+y^2)^2} dx \; dy \;\;\; \text{for} \; x>0, y>0$$

If you’d like to try this out for yourself, then please do so now. I will provide the solution below.

The reason why this problem appears to be so difficult is because seeing the x² and the y² would incline someone to try and convert to cylindrical co-ordinates. I tried that myself and was not able to work it out.

The solution I have is as follows:

$$\int \int \frac{x^2 -y^2}{(x^2+y^2)^2} dx \; dy$$

$$\text{First, we generate a partial fraction expansion of the integrand:}\\ =\int \int \frac{1}{(x^2+y^2)} – \frac{2y^2}{(x^2+y^2)^2}dx \; dy\\ \text{Split the integral up and factor out the constants:}\\ =\int \int \frac{1}{(x^2+y^2)} dx \; dy + \int -2y^2 \int \frac{1}{(x^2+y^2)^2}dx \; dy\\ \text{Since y is constant, factor out } \frac{1}{y^2} \text{ from the first integral:}\\ =\int \frac{1}{y^2} \int \frac{1}{(\frac{x^2}{y^2}+1)} dx \; dy + \int -2y^2 \int \frac{1}{(x^2+y^2)^2}dx \; dy\\$$

$$\text{For } \frac{1}{\frac{x^2}{y^2} + 1} \text{ , sub } p=\frac{x}{y}\\ \text{Therefore, } dx =y\,dp\\$$

$$\text{For } \frac{1}{(x^2+y^2)^2} \text{ , sub } x=y \tan (u)\\ \text{Therefore, } dx =y \sec ^2(u) \; du\\ \text{Then, } \frac{1}{(x^2 + y^2)^2} = \frac{1}{(y^2 \tan ^2(u) + y^2)^2} = \frac{1}{(y^2 \sec ^2(u))^2} = \frac{1}{y^4 \sec ^4(u)}$$

$$\text{This gives us:}\\ =\int \frac{1}{y^2} \int \frac{y}{p^2+1} dp \; dy + \int -2y^2 \int \frac{y \sec ^2(u)}{y^4 \sec ^4 (u)}du \; dy\\ =\int \frac{1}{y} \int \frac{1}{p^2+1} dp \; dy + \int -\frac{2}{y} \int \frac{1}{\sec ^2 (u)}du \; dy\\ =\int \frac{1}{y} \int \frac{1}{p^2+1} dp \; dy + \int -\frac{2}{y} \int \cos ^2(u) du \; dy\\ \text{Now, we use the double angle formula } \cos (2u) \equiv 2 \cos ^2(u) -1\\ =\int \frac{1}{y} \int \frac{1}{p^2+1} dp \; dy + \int -\frac{2}{y} \int \frac{\cos (2u) + 1}{2} du \; dy\\ \text{We are now in a position to integrate:}\\ =\int \frac{\arctan (p)}{y} dy + \int -\frac{2}{y} \frac{\frac{\sin (2u)}{2} + u}{2} dy\\ =\int \frac{\arctan (p)}{y} dy + \int -\frac{\sin (2u) + 2u}{2y} dy\\ \text{Now, we use the double angle formula } \sin (2u) \equiv 2 \sin (u) \cos (u)\\ =\int \frac{\arctan (p)}{y} dy + \int -\frac{2 \sin (u) \cos (u) + 2u}{2y} dy\\ =\int \frac{\arctan (p)}{y} dy + \int -\frac{\sin (u) \cos (u) + u}{y} dy\\ \text{Combine the integrals:}\\ =\int \frac{\arctan (p) – \sin (u) \cos (u) -u}{y} dy\\ \text{Sub back } p=\frac{x}{y} \text{ and } u= \arctan (\frac{x}{y})\\ =\int \frac{\arctan (\frac{x}{y}) – \sin (\arctan (\frac{x}{y})) \cos (\arctan (\frac{x}{y})) -\arctan (\frac{x}{y})}{y} dy\\ =\int \frac{- \sin (\arctan (\frac{x}{y})) \cos (\arctan (\frac{x}{y}))}{y} dy\\$$

$$\text{Now, use the inverse trigonometric identities:}\\ \sin (\arctan (x)) \equiv \frac{x}{\sqrt{1+x^2}}\\ \cos (\arctan (1)) \equiv \frac{1}{\sqrt{1+x^2}}\\$$

$$\text{This gives us:}\\ =\int \frac{- \frac{\frac{x}{y}}{\sqrt{1+(\frac{x}{y})^2}} \frac{1}{\sqrt{1+(\frac{x}{y})^2}} }{y} dy\\ =\int \frac{- \frac{\frac{x}{y}}{1+(\frac{x}{y})^2}}{y} dy\\ =\int \frac{- \frac{x}{y+ y(\frac{x}{y})^2}}{y} dy\\ =\int – \frac{x}{y^2+ y^2(\frac{x}{y})^2} dy\\ =\int – \frac{x}{y^2+ x^2} dy\\ \text{Since } x \text{ is a constant, we can factor it out:}\\ =-\frac{1}{x} \int \frac{1}{\frac{y^2}{x^2} +1} dy\\$$

$$\text{Sub } u=\frac{y}{x}\\ \text{Therefore, } dy =x \; du\\$$

$$\text{This gives us:}\\ =-\frac{1}{x} \int \frac{x}{u^2 +1} du\\ =-\int \frac{1}{u^2 +1} du\\ =- \arctan (u)\\ \text{Sub back } u = \frac{y}{x} \text{ :}\\ =- \arctan (\frac{y}{x})\\ \text{Add the constants of integration back in if needed:}\\ =- \arctan (\frac{y}{x}) + C_1x + C_2$$

And there we have it! In case you were curious as to how I was able to type out some very pretty mathematical symbols, I used LaTeX, which is an engine used to render mathematical symbols. If you are a mathematician and haven’t been exposed to it, you should check it out! It’s really cool!

This entry was posted in Yay. Bookmark the permalink.

This site uses Akismet to reduce spam. Learn how your comment data is processed.