1. ## Integral

Evaluate the integral $\int_0^2(arctan(\pi x)-arctan (x)dx.$

Hint: Write the integrand as an integral.
This is what i've done so far:

$y=Aarctan(Bx) \Rightarrow \ tan \left( \frac{y}{A} \right)=B$

$\frac{dy}{dx}\frac{1}{cos^2 \left(\frac{y}{A} \right)}=B \Rightarrow \ \frac{dy}{dx}=Bcos^2 \left( \frac{y}{A} \right)$

This was to just get my bearings with what the integral should look like.

In double integral form, the initial integral is:

$\int_0^2 \int_x^{\pi x} cos^2 (y) \ dy \ dx$

Call the region we're integrating over R.
Let $R_1=\{ (x,y):\frac{y}{\pi} \leq x \leq y, \ 0 \leq y \leq 2 \}$ and $R_2=\{(x,y):\frac{y}{\pi} \leq x \leq 2, \ 2 \leq y \leq 2 \pi \}$.

$R= R_1 \cup R_2$.

This gives:

$\int_0^2 \int_{\frac{y}{\pi}}^y cos^2 y \ dx \ dy + \int_2^{2 \pi} \int_{\frac{y}{\pi}}^2 cos^2 y \ dx \ dy$

$\int_0^2 ycos^2 (y)-\frac{y}{\pi} cos^2(y)dy+\int_2^{2 \pi} 2cos^2(y)-\frac{y}{\pi}cos^2(y)dy$

$\int_0^{2 \pi} \left( y+2-\frac{2y}{\pi} \right) cos^2(y) \ dy$

Integrating by parts gives:

$\left[ arctan(y) \left( y+2-\frac{2y}{\pi} \right) \right]_0^{2 \pi}- \left( 1-\frac{2}{\pi} \right) \int_0^{2 \pi} arctan (y)\ dy$

$(2 \pi -2)arctan(2 \pi)- \left(1-\frac{2}{\pi} \right) \left[yarctan(y)-\frac{1}{2}ln (1+y^2) \right]_0^{2 \pi}$

$(2 \pi -2)arctan(2 \pi)-\left( 1-\frac{2}{\pi} \right) \left(2 \pi arctan (2 \pi) -\frac{1}{2}ln(1+4 \pi^2) \right)$

$2arctan (2 \pi)+\left( \frac{1}{2}-\frac{1}{\pi} \right) ln (1+4 \pi^2)$

Firstly, is this answer correct?
Secondly, is there an easier way to do it than this??

2. Originally Posted by Showcase_22
This is what i've done so far:

$y=Aarctan(Bx) \Rightarrow \ tan \left( \frac{y}{A} \right)=B$

$\frac{dy}{dx}\frac{1}{cos^2 \left(\frac{y}{A} \right)}=B \Rightarrow \ \frac{dy}{dx}=Bcos^2 \left( \frac{y}{A} \right)$

This was to just get my bearings with what the integral should look like.

In double integral form, the initial integral is:

$\int_0^2 \int_x^{\pi x} cos^2 (y) \ dy \ dx$

Call the region we're integrating over R.
Let $R_1=\{ (x,y):\frac{y}{\pi} \leq x \leq y, \ 0 \leq y \leq 2 \}$ and $R_2=\{(x,y):\frac{y}{\pi} \leq x \leq 2, \ 2 \leq y \leq 2 \pi \}$.

$R= R_1 \cup R_2$.

This gives:

$\int_0^2 \int_{\frac{y}{\pi}}^y cos^2 y \ dx \ dy + \int_2^{2 \pi} \int_{\frac{y}{\pi}}^2 cos^2 y \ dx \ dy$

$\int_0^2 ycos^2 (y)-\frac{y}{\pi} cos^2(y)dy+\int_2^{2 \pi} 2cos^2(y)-\frac{y}{\pi}cos^2(y)dy$

$\int_0^{2 \pi} \left( y+2-\frac{2y}{\pi} \right) cos^2(y) \ dy$

Integrating by parts gives:

$\left[ arctan(y) \left( y+2-\frac{2y}{\pi} \right) \right]_0^{2 \pi}- \left( 1-\frac{2}{\pi} \right) \int_0^{2 \pi} arctan (y)\ dy$

$(2 \pi -2)arctan(2 \pi)- \left(1-\frac{2}{\pi} \right) \left[yarctan(y)-\frac{1}{2}ln (1+y^2) \right]_0^{2 \pi}$

$(2 \pi -2)arctan(2 \pi)-\left( 1-\frac{2}{\pi} \right) \left(2 \pi arctan (2 \pi) -\frac{1}{2}ln(1+4 \pi^2) \right)$

$2arctan (2 \pi)+\left( \frac{1}{2}-\frac{1}{\pi} \right) ln (1+4 \pi^2)$

Firstly, is this answer correct?
Secondly, is there an easier way to do it than this??

$I = \int_{x = 0}^{x = 2} \int_{t = x}^{t = \pi x} \frac{1}{1 + t^2} \, dt \, dx$

and then reverse the order of integration (do the reversal carefully, it needs to be broken up into two seperate double integrals).

3. That's probably a better way of doing it

The reversal is the same as what I reversed previously so the integral is now $
\int_0^2 \int_{\frac{y}{\pi}}^y \frac{1}{1+y^2} \ dx \ dy + \int_2^{2 \pi} \int_{\frac{y}{\pi}}^2 \frac{1}{1+y^2} \ dx \ dy
$
(where y=t).

$\int_0^2 \left[ \frac{x}{1+y^2} \right]_{\frac{y}{\pi}}^y \ dy+\int_2^{2 \pi} \left[ \frac{x}{1+y^2} \right]_{\frac{y}{\pi}}^2 \ dy$

$\int_0^2 \frac{y}{1+y^2}-\frac{\frac{y}{\pi}}{1+y^2} \ dy+ \int_2^{2 \pi} \frac{2}{1+y^2}-\frac{\frac{y}{\pi}}{1+y^2} \ dy$

$\int_0^{2 \pi} \frac{y+2-\frac{2y}{\pi}}{1+y^2} \ dy$

Let $u=1+y^2 \Rightarrow \ \frac{du}{dy}=2y$

$\int_1^{4 \pi^2+1} \frac{y-\frac{2y}{\pi}}{u} \ \frac{du}{2y}+\int_0^{2\pi}\frac{2}{1+y^2} \ dy$

$\frac{1}{2}\int_1^{4 \pi ^2+1} \frac{1-\frac{2}{\pi}}{u} \ du+ \int_0^{2 \pi}\frac{2}{1+y^2} \ dy$

$\frac{1}{2}\left( 1-\frac{2}{\pi} \right) \left[ ln(u) \right]_1^{4 \pi^2+1}+2 \left[arctan(y) \right]_0^{2 \pi}$

$\frac{1}{2}\left( 1-\frac{2}{\pi} \right) ln(4 \pi^2+1)+2arctan( 2\pi)$

$\left( \frac{1}{2}-\frac{1}{\pi} \right) ln(4 \pi^2+1)+2arctan( 2\pi)$

Which is the same as before.

Well that was a good way of doing it, but can't you do the initial integral without splitting it up into two double integrals?

4. Why not integrate $\int_0^2 \tan^{-1}\pi x - \tan^{-1}x\, dx$ directly using parts?

5. I have no idea, I only did it this way because this is how the question wanted me to do it.

Perhaps there exist some integrals that can only be solved by turning them into double integrals. If you look at the second method, $tan^{-1}x$ is never integrated directly.

I can't actually think of any integrals that can only be solved by turning them into a double integral, so i'm only really speculating about where this method would be useful.

6. Originally Posted by Showcase_22

but can't you do the initial integral without splitting it up into two double integrals?
$\int_{0}^{2}{\left( \arctan \pi x-\arctan x \right)\,dx}=\int_{0}^{2}{\int_{1}^{\pi }{\frac{x}{1+t^{2}x^{2}}\,dt}\,dx}=\frac{1}{2}\int _{1}^{\pi }{\frac{\ln \left( 4t^{2}+1 \right)}{t^{2}}\,dt}.$

7. Originally Posted by Showcase_22
I have no idea, I only did it this way because this is how the question wanted me to do it.

Perhaps there exist some integrals that can only be solved by turning them into double integrals. If you look at the second method, $tan^{-1}x$ is never integrated directly.

I can't actually think of any integrals that can only be solved by turning them into a double integral, so i'm only really speculating about where this method would be useful.
Here's one would it would be beneficial (this is from Stewart's Calculus book)

$\int_0^{\infty} \frac{\tan^{-1}\pi x - \tan^{-1}x}{x}\, dx$

and follow Krizalid's approach.

8. I was just trying Danny's post and there's something about Krizalid's post I don't quite understand.

$
\int_{0}^{2}{\left( \arctan \pi x-\arctan x \right)\,dx}=\int_{0}^{2}{\int_{1}^{\pi }{\frac{\color{red}{x}}{1+t^{2}x^{2}}\,dt}\,dx}=\f rac{1}{2}\int_{1}^{\pi }{\frac{\ln \left( 4t^{2}+1 \right)}{t^{2}}\,dt}.
$
Should that be an x or a 1?

$
\int_{0}^{2}{\int_{1}^{\pi }{\frac{x}{1+t^{2}x^{2}}\,dt}\,dx}
$

$
\int_{0}^{2}x{\int_{1}^{\pi }{\frac{1}{1+t^{2}x^{2}}\,dt}\,dx}
$

Let $tx=tan(u) \Rightarrow \frac{dt}{du}=sec^2(u)$

$\int_0^2 x \int_{arctan(x)}^{arctan(\pi x)} du \ dx$

$\int_0^2 x(arctan( \pi x)-arctan(x)) dx$

I just want to clarify this before I try the other integral.

9. Originally Posted by Showcase_22
I was just trying Danny's post and there's something about Krizalid's post I don't quite understand.

Should that be an x or a 1?

$
\int_{0}^{2}{\int_{1}^{\pi }{\frac{x}{1+t^{2}x^{2}}\,dt}\,dx}
$

$
\int_{0}^{2}x{\int_{1}^{\pi }{\frac{1}{1+t^{2}x^{2}}\,dt}\,dx}
$

Let $tx=tan(u) \Rightarrow \frac{dt}{du}=sec^2(u)$ where did your x go ?

$\int_0^2 x \int_{arctan(x)}^{arctan(\pi x)} du \ dx$

$\int_0^2 x(arctan( \pi x)-arctan(x)) dx$

I just want to clarify this before I try the other integral.
..

Bobak

10. I think I just did something a bit silly.

I thought that since the first integral is w.r.t t, then one is able to take the x (which is treated as a constant) out of the integral.

Can you do that?

11. Originally Posted by Showcase_22
I think I just did something a bit silly.

I thought that since the first integral is w.r.t t, then one is able to take the x (which is treated as a constant) out of the integral.

Can you do that?

you have $t =\frac{\tan u }{x}$ with x constant
$\frac{dt}{du} = \frac{sec^2 u }{x}$

12. Ah no, I see I was wrong (pretty much for the same reason I was defending myself with)

Anyway, i'll get cracking on the other integral which was posted.