+0  
 
+5
1271
11
avatar+9673 

 Today our 'gifted maths' class teacher gave us a hard integration problem: \(\displaystyle\int \sqrt{\tan x}\mathtt{dx}\). Below is my solution to the question. Someone please check the answer for me? :)

\(\displaystyle\int \sqrt{\tan x}\mathtt{dx}\\ \text{Let u =}\sqrt{\tan x}\\ u^2 = \tan x\\ 2u\dfrac{\mathtt{du}}{\mathtt{dx}}=\sec^2 x\\ \mathtt{dx} = \dfrac{2u\mathtt{du}}{\sec^2 x}\\ \dfrac{\text{opposite}}{\text{adjacent}}=\tan x = u^2\\ \text{opposite} = u^2\text{, }\text{adjacent} = 1\\ \therefore \text{hypotenuse} = \sqrt{1+u^4}\\ \sec^2 x = \dfrac{\text{hypotenuse}^2}{\text{adjacent}^2}=1+u^4\)

 

\(\displaystyle\int \sqrt{\tan x}\mathtt{dx}\\ =2\displaystyle\int\dfrac{u^2\mathtt{du}}{\sec^2 x}\\ =2\displaystyle\int\dfrac{u^2\mathtt{du}}{u^4+1} \\ =2\displaystyle\int\dfrac{\mathtt{du}}{u^2 + \frac{1}{u^2}} \\=\displaystyle\int\dfrac{2\mathtt{du}}{u^2 + \frac{1}{u^2}}\\ =\displaystyle\int\dfrac{1+1}{u^2 + \frac{1}{u^2}}\mathtt{du}\\ =\displaystyle\int\dfrac{\left(1+\frac{1}{u^2}\right)+\left(1-\frac{1}{u^2}\right)}{u^2 + \frac{1}{u^2}}\mathtt{du}\\ =\displaystyle\int\left(\dfrac{1+\frac{1}{u^2}}{u^2+\frac{1}{u^2}}+\dfrac{1-\frac{1}{u^2}}{u^2+\frac{1}{u^2}}\right)\mathtt{du} \)

 

\(\quad\text{Let t = }u-\dfrac{1}{u}\\ \quad\dfrac{\mathtt{dt}}{\mathtt{du}}=1+\dfrac{1}{u^2}\\ \quad\mathtt{dt} = \left(1+\dfrac{1}{u^2}\right)\mathtt{du}\\ =\displaystyle\int\dfrac{\mathtt{dt}}{t^2+2}+\displaystyle\int\dfrac{1+\frac{1}{u^2}-\frac{2}{u^2}}{u^2+\frac{1}{u^2}}\mathtt{du}\\ \quad\text{Let } t = \sqrt2\tan v\\ \quad v = \arctan \left(\dfrac{t}{\sqrt2}\right)\\ \quad \mathtt{dt}=\sqrt2 \sec^2 v \mathtt{dv}\\ =\displaystyle\int\dfrac{\sqrt2\sec^2 v\mathtt{dv}}{2\sec^2 v}+\displaystyle\int\dfrac{1+\frac{1}{u^2}}{u^2+\frac{1}{u^2}}\mathtt{du}-\displaystyle\int\dfrac{\frac{2}{u^2}}{u^2+\frac{1}{u^2}}\mathtt{du}\\ =\dfrac{1}{\sqrt2}\arctan\left(\dfrac{t}{\sqrt2}\right)+\displaystyle\int\dfrac{t}{t^2+2}\mathtt{dt}-\displaystyle\int\dfrac{\frac{2}{u^2}}{u^2+\frac{1}{u^2}}\mathtt{du}\\ =\dfrac{1}{\sqrt2}\arctan\left(\dfrac{t}{\sqrt2}\right)+\dfrac{\ln|t^2+2|}{2}-2\displaystyle\int\dfrac{1}{u^4 +1}\mathtt{du}\\ =\dfrac{1}{\sqrt2}\arctan\left(\dfrac{u^2-1}{\sqrt2u}\right)+\dfrac{\ln|u^2+\frac{1}{u^2}|}{2}-2\displaystyle\int\dfrac{1}{u^4+1}\)

 

\(\quad\text{Let }j = u-\dfrac{1}{u}\\ \quad \text{Let }k = u+\dfrac{1}{u}\\ \quad \mathtt{dj} = (1+\dfrac{1}{u^2})\mathtt{du}\\ \quad \mathtt{dk} = (1 - \dfrac{1}{u^2})\mathtt{du}\\ =\dfrac{1}{\sqrt2}\arctan\left(\dfrac{u^2-1}{\sqrt2u}\right)+\dfrac{\ln|u^2+\frac{1}{u^2}|}{2}-\displaystyle\int\dfrac{u^2+1-u^2+1}{u^4+1}\mathtt{du}\\ =\dfrac{1}{\sqrt2}\arctan\left(\dfrac{u^2-1}{\sqrt2u}\right)+\dfrac{\ln|u^2+\frac{1}{u^2}|}{2}-\displaystyle\int\dfrac{u^2+1}{u^4+1}\mathtt{du}+\displaystyle\int\dfrac{u^2-1}{u^4+1}\mathtt{du}\\ =\dfrac{1}{\sqrt2}\arctan\left(\dfrac{u^2-1}{\sqrt2u}\right)+\dfrac{\ln|u^2+\frac{1}{u^2}|}{2}-\displaystyle\int\dfrac{1+\frac{1}{u^2}}{u^2+\frac{1}{u^2}}\mathtt{du}+\displaystyle\int\dfrac{1-\frac{1}{u^2}}{u^2+\frac{1}{u^2}}\mathtt{du}\\ =\dfrac{1}{\sqrt2}\arctan\left(\dfrac{u^2-1}{\sqrt2u}\right)+\dfrac{\ln|u^2+\frac{1}{u^2}|}{2}-\displaystyle\int\dfrac{\mathtt{dj}}{j^2+2}+\displaystyle\int\dfrac{\mathtt{dk}}{k^2+2}\\ =\dfrac{1}{\sqrt2}\arctan\left(\dfrac{u^2-1}{\sqrt2u}\right)+\dfrac{\ln|u^2+\frac{1}{u^2}|}{2}-\dfrac{\ln|u^2+\frac{1}{u^2}-2|}{2}+\dfrac{\ln|u^2+\frac{1}{u^2}+2|}{2}+C\\ =\dfrac{1}{\sqrt2}\arctan\left(\dfrac{\tan x-1}{\sqrt{2\tan x}}\right)+\dfrac{\ln|\tan x+\cot x|}{2}-\dfrac{\\tan x+\cot x-2|}{2}+\dfrac{\ln|\tan x+\cot x+2|}{2}+C\) \(\therefore \displaystyle\int \sqrt{\tan x}=\dfrac{1}{\sqrt2}\arctan\left(\dfrac{\tan x-1}{\sqrt{2\tan x}}\right)+\dfrac{\ln|\tan x+\cot x|}{2}-\dfrac{\\tan x+\cot x-2|}{2}+\dfrac{\ln|\tan x+\cot x+2|}{2}+C\)

 Dec 30, 2016

Best Answer 

 #3
avatar+37146 
+10

I would recommend (as I mentioned a couple of days ago)  checking out  integral-calculator.com.....

 Dec 30, 2016
 #1
avatar+9673 
+5

Took me an hour to type it out. LOL

 Dec 30, 2016
 #2
avatar+118673 
+10

Yes i bet it took you over an hour to code.  Very impressive it is too :)

 

I will look at it but not till morning.  I'm beat, sorry :)

Melody  Dec 30, 2016
 #3
avatar+37146 
+10
Best Answer

I would recommend (as I mentioned a couple of days ago)  checking out  integral-calculator.com.....

ElectricPavlov Dec 30, 2016
 #4
avatar
+5

SORRY MAX! EVEN MUCH LONGER THAN YOURS.

 

Take the integral:
 integral sqrt(tan(x)) dx
For the integrand sqrt(tan(x)), substitute u = tan(x) and du = sec^2(x) dx:
 = integral sqrt(u)/(u^2 + 1) du
For the integrand sqrt(u)/(u^2 + 1), substitute s = sqrt(u) and ds = 1/(2 sqrt(u)) du:
 = 2 integral s^2/(s^4 + 1) ds
For the integrand s^2/(s^4 + 1), use partial fractions:
 = 2 integral(-s/(2 sqrt(2) (-s^2 + sqrt(2) s - 1)) - s/(2 sqrt(2) (s^2 + sqrt(2) s + 1))) ds
Integrate the sum term by term and factor out constants:
 = -1/sqrt(2) integral s/(s^2 + sqrt(2) s + 1) ds - 1/sqrt(2) integral s/(-s^2 + sqrt(2) s - 1) ds
Rewrite the integrand s/(s^2 + sqrt(2) s + 1) as (2 s + sqrt(2))/(2 (s^2 + sqrt(2) s + 1)) - 1/(sqrt(2) (s^2 + sqrt(2) s + 1)):
 = -1/sqrt(2) integral((2 s + sqrt(2))/(2 (s^2 + sqrt(2) s + 1)) - 1/(sqrt(2) (s^2 + sqrt(2) s + 1))) ds - 1/sqrt(2) integral s/(-s^2 + sqrt(2) s - 1) ds
Integrate the sum term by term and factor out constants:
 = -1/(2 sqrt(2)) integral(2 s + sqrt(2))/(s^2 + sqrt(2) s + 1) ds + 1/2 integral1/(s^2 + sqrt(2) s + 1) ds - 1/sqrt(2) integral s/(-s^2 + sqrt(2) s - 1) ds
For the integrand (2 s + sqrt(2))/(s^2 + sqrt(2) s + 1), substitute p = s^2 + sqrt(2) s + 1 and dp = (2 s + sqrt(2)) ds:
 = -1/(2 sqrt(2)) integral1/p dp + 1/2 integral1/(s^2 + sqrt(2) s + 1) ds - 1/sqrt(2) integral s/(-s^2 + sqrt(2) s - 1) ds
The integral of 1/p is log(p):
 = -(log(p))/(2 sqrt(2)) + 1/2 integral1/(s^2 + sqrt(2) s + 1) ds - 1/sqrt(2) integral s/(-s^2 + sqrt(2) s - 1) ds
For the integrand 1/(s^2 + sqrt(2) s + 1), complete the square:
 = -(log(p))/(2 sqrt(2)) + 1/2 integral1/((s + 1/sqrt(2))^2 + 1/2) ds - 1/sqrt(2) integral s/(-s^2 + sqrt(2) s - 1) ds
For the integrand 1/((s + 1/sqrt(2))^2 + 1/2), substitute w = s + 1/sqrt(2) and dw = ds:
 = -(log(p))/(2 sqrt(2)) + 1/2 integral1/(w^2 + 1/2) dw - 1/sqrt(2) integral s/(-s^2 + sqrt(2) s - 1) ds
Factor 1/2 from the denominator:
 = -(log(p))/(2 sqrt(2)) + 1/2 integral2/(2 w^2 + 1) dw - 1/sqrt(2) integral s/(-s^2 + sqrt(2) s - 1) ds
Factor out constants:
 = -(log(p))/(2 sqrt(2)) + integral1/(2 w^2 + 1) dw - 1/sqrt(2) integral s/(-s^2 + sqrt(2) s - 1) ds
For the integrand 1/(2 w^2 + 1), substitute v = sqrt(2) w and dv = sqrt(2) dw:
 = -(log(p))/(2 sqrt(2)) + 1/sqrt(2) integral1/(v^2 + 1) dv - 1/sqrt(2) integral s/(-s^2 + sqrt(2) s - 1) ds
The integral of 1/(v^2 + 1) is tan^(-1)(v):
 = (tan^(-1)(v))/sqrt(2) - (log(p))/(2 sqrt(2)) - 1/sqrt(2) integral s/(-s^2 + sqrt(2) s - 1) ds
Rewrite the integrand s/(-s^2 + sqrt(2) s - 1) as 1/(sqrt(2) (-s^2 + sqrt(2) s - 1)) - (sqrt(2) - 2 s)/(2 (-s^2 + sqrt(2) s - 1)):
 = (tan^(-1)(v))/sqrt(2) - (log(p))/(2 sqrt(2)) - 1/sqrt(2) integral(1/(sqrt(2) (-s^2 + sqrt(2) s - 1)) - (sqrt(2) - 2 s)/(2 (-s^2 + sqrt(2) s - 1))) ds
Integrate the sum term by term and factor out constants:
 = (tan^(-1)(v))/sqrt(2) - (log(p))/(2 sqrt(2)) + 1/(2 sqrt(2)) integral(sqrt(2) - 2 s)/(-s^2 + sqrt(2) s - 1) ds - 1/2 integral1/(-s^2 + sqrt(2) s - 1) ds
For the integrand (sqrt(2) - 2 s)/(-s^2 + sqrt(2) s - 1), substitute z_1 = -s^2 + sqrt(2) s - 1 and dz_1 = (sqrt(2) - 2 s) ds:
 = (tan^(-1)(v))/sqrt(2) - (log(p))/(2 sqrt(2)) + 1/(2 sqrt(2)) integral1/z_1 dz_1 - 1/2 integral1/(-s^2 + sqrt(2) s - 1) ds
The integral of 1/z_1 is log(z_1):
 = (tan^(-1)(v))/sqrt(2) - (log(p))/(2 sqrt(2)) + (log(z_1))/(2 sqrt(2)) - 1/2 integral1/(-s^2 + sqrt(2) s - 1) ds
For the integrand 1/(-s^2 + sqrt(2) s - 1), complete the square:
 = (tan^(-1)(v))/sqrt(2) - (log(p))/(2 sqrt(2)) + (log(z_1))/(2 sqrt(2)) - 1/2 integral1/(-(s - 1/sqrt(2))^2 - 1/2) ds
For the integrand 1/(-(s - 1/sqrt(2))^2 - 1/2), substitute z_2 = s - 1/sqrt(2) and dz_2 = ds:
 = (tan^(-1)(v))/sqrt(2) - (log(p))/(2 sqrt(2)) + (log(z_1))/(2 sqrt(2)) - 1/2 integral1/(-z_2^2 - 1/2) dz_2
Factor -1/2 from the denominator:
 = (tan^(-1)(v))/sqrt(2) - (log(p))/(2 sqrt(2)) + (log(z_1))/(2 sqrt(2)) - 1/2 integral2/(-2 z_2^2 - 1) dz_2
Factor out constants:
 = (tan^(-1)(v))/sqrt(2) - (log(p))/(2 sqrt(2)) + (log(z_1))/(2 sqrt(2)) - integral1/(-2 z_2^2 - 1) dz_2
Factor -1 from the denominator:
 = (tan^(-1)(v))/sqrt(2) - (log(p))/(2 sqrt(2)) + (log(z_1))/(2 sqrt(2)) + integral1/(2 z_2^2 + 1) dz_2
For the integrand 1/(2 z_2^2 + 1), substitute z_3 = sqrt(2) z_2 and dz_3 = sqrt(2) dz_2:
 = (tan^(-1)(v))/sqrt(2) - (log(p))/(2 sqrt(2)) + (log(z_1))/(2 sqrt(2)) + 1/sqrt(2) integral1/(z_3^2 + 1) dz_3
The integral of 1/(z_3^2 + 1) is tan^(-1)(z_3):
 = -(log(p))/(2 sqrt(2)) + (tan^(-1)(v))/sqrt(2) + (log(z_1))/(2 sqrt(2)) + (tan^(-1)(z_3))/sqrt(2) + constant
Substitute back for z_3 = sqrt(2) z_2:
 = -(log(p))/(2 sqrt(2)) + (tan^(-1)(v))/sqrt(2) + (log(z_1))/(2 sqrt(2)) + (tan^(-1)(sqrt(2) z_2))/sqrt(2) + constant
Substitute back for z_2 = s - 1/sqrt(2):
 = -(log(p))/(2 sqrt(2)) - (tan^(-1)(1 - sqrt(2) s))/sqrt(2) + (tan^(-1)(v))/sqrt(2) + (log(z_1))/(2 sqrt(2)) + constant
Substitute back for z_1 = -s^2 + sqrt(2) s - 1:
 = -(log(p))/(2 sqrt(2)) + (log(-s^2 + sqrt(2) s - 1))/(2 sqrt(2)) - (tan^(-1)(1 - sqrt(2) s))/sqrt(2) + (tan^(-1)(v))/sqrt(2) + constant
Substitute back for v = sqrt(2) w:
 = -(log(p))/(2 sqrt(2)) + (log(-s^2 + sqrt(2) s - 1))/(2 sqrt(2)) - (tan^(-1)(1 - sqrt(2) s))/sqrt(2) + (tan^(-1)(sqrt(2) w))/sqrt(2) + constant
Substitute back for w = s + 1/sqrt(2):
 = -(log(p))/(2 sqrt(2)) + (log(-s^2 + sqrt(2) s - 1))/(2 sqrt(2)) - (tan^(-1)(1 - sqrt(2) s))/sqrt(2) + (tan^(-1)(sqrt(2) s + 1))/sqrt(2) + constant
Substitute back for p = s^2 + sqrt(2) s + 1:
 = (log(-s^2 + sqrt(2) s - 1))/(2 sqrt(2)) - (log(s^2 + sqrt(2) s + 1))/(2 sqrt(2)) - (tan^(-1)(1 - sqrt(2) s))/sqrt(2) + (tan^(-1)(sqrt(2) s + 1))/sqrt(2) + constant
Substitute back for s = sqrt(u):
 = (log(-u + sqrt(2) sqrt(u) - 1))/(2 sqrt(2)) - (log(u + sqrt(2) sqrt(u) + 1))/(2 sqrt(2)) - (tan^(-1)(1 - sqrt(2) sqrt(u)))/sqrt(2) + (tan^(-1)(sqrt(2) sqrt(u) + 1))/sqrt(2) + constant
Substitute back for u = tan(x):
 = -(tan^(-1)(1 - sqrt(2) sqrt(tan(x))))/sqrt(2) + (tan^(-1)(sqrt(2) sqrt(tan(x)) + 1))/sqrt(2) + (log(-tan(x) + sqrt(2) sqrt(tan(x)) - 1))/(2 sqrt(2)) - (log(tan(x) + sqrt(2) sqrt(tan(x)) + 1))/(2 sqrt(2)) + constant
Factor the answer a different way:
 = (-2 tan^(-1)(1 - sqrt(2) sqrt(tan(x))) + 2 tan^(-1)(sqrt(2) sqrt(tan(x)) + 1) + log(-tan(x) + sqrt(2) sqrt(tan(x)) - 1) - log(tan(x) + sqrt(2) sqrt(tan(x)) + 1))/(2 sqrt(2)) + constant
An alternative form of the integral is:
 = (-2 tan^(-1)(1 - sqrt(2) sqrt(tan(x))) + 2 tan^(-1)(sqrt(2) sqrt(tan(x)) + 1) + log(-(tan(x) - sqrt(2) sqrt(tan(x)) + 1)/(tan(x) + sqrt(2) sqrt(tan(x)) + 1)))/(2 sqrt(2)) + constant
Which is equivalent for restricted x values to:
Answer: |= (-2 tan^(-1)(1 - sqrt(2) sqrt(tan(x))) + 2 tan^(-1)(sqrt(2) sqrt(tan(x)) + 1) + log(tan(x) - sqrt(2) sqrt(tan(x)) + 1) - log(tan(x) + sqrt(2) sqrt(tan(x)) + 1))/(2 sqrt(2)) + constant

 Dec 30, 2016
 #5
avatar+9673 
+5

Wow. Much longer than I thought. Thanks 

MaxWong  Jan 1, 2017
 #6
avatar+118673 
0

Max, do you have access to Wolfram|Alpha,

the pay version?

 

I did it there.

I've downloaded the answer to my computer but Tiny Pics refuses to upload it - probably becasue it is very long .

So I can't post it easily.  

Do you want me to continue to try and post it here or have you got the problem sorted now.

 

(I have not personally worked through any of the mathematics for it.)

 Jan 1, 2017
 #7
avatar+118673 
0

Oh I just reread EP's suggestion.

Maybe they do it much better there.

I must check it out - thanks EP

Melody  Jan 1, 2017
 #9
avatar+9673 
0

I did not pay for the W|A so I do not have access.

MaxWong  Jan 1, 2017
 #8
avatar+118673 
0

THANKS EP !!!

 

The integral calculator that EP found works and absolute treat!

 

Check it out !!!

 

http://www.integral-calculator.com/

 Jan 1, 2017
 #10
avatar+9673 
+5

Also this awesome derivative calculator here!!

http://www.derivative-calculator.net/

MaxWong  Jan 1, 2017
 #11
avatar+118673 
+5

Thanks very much Max.

It is really great to know about all these wonderful internet tools.

I did not know about either of these sites before :)

Melody  Jan 1, 2017

3 Online Users

avatar