# Could someone please help me Integrate this equation?

**URL:** https://boards.straightdope.com/t/could-someone-please-help-me-integrate-this-equation/117860
**Category:** Factual Questions
**Created:** [July 8, 2002, 2:57am UTC](https://boards.straightdope.com/t/could-someone-please-help-me-integrate-this-equation/117860 "2002-07-08T02:57:21Z")
**Posts on this page:** 16
**Page:** 1

<div class="post-metadata">

### Author: ![Muad\_Dib](https://avatars.discourse-cdn.com/v4/letter/m/35a633/32.png) [@Muad\_Dib](https://boards.straightdope.com/u/Muad_Dib)
#### Post date: [July 8, 2002, 2:57am UTC](https://boards.straightdope.com/t/could-someone-please-help-me-integrate-this-equation/117860/1 "2002-07-08T02:57:21Z")

</div>

First off, this is not part of a problem set, this is not direct homework. I am studying for a test tomorrow and am stuck on this problem.

Integrate( (1+tan)^(1/2) )

If someone could just tell me the next step, that would be enough.

---

<div class="post-metadata">

### Author: ![Muad\_Dib](https://avatars.discourse-cdn.com/v4/letter/m/35a633/32.png) [@Muad\_Dib](https://boards.straightdope.com/u/Muad_Dib)
#### Post date: [July 8, 2002, 3:23am UTC](https://boards.straightdope.com/t/could-someone-please-help-me-integrate-this-equation/117860/2 "2002-07-08T03:23:29Z")

</div>

Ohhhh… Wait a sec, I farked up. The equation is (1+tan^2)^(1/2). That is easily solved with a trignometric substitution.  
However, I would still like to know if the other one can be solved.

---

<div class="post-metadata">

### Author: ![ultrafilter](https://avatars.discourse-cdn.com/v4/letter/u/3d9bf3/32.png) [@ultrafilter](https://boards.straightdope.com/u/ultrafilter)
#### Post date: [July 8, 2002, 3:24am UTC](https://boards.straightdope.com/t/could-someone-please-help-me-integrate-this-equation/117860/3 "2002-07-08T03:24:00Z")

</div>

That’s sqrt(1 + tan(x)), right? I’m not sure what to do with that one. Maybe substitute for 1 + tan(x) and integrate by parts?

If, however, it were sqrt(1 + tan(x)[sup]2[/sup]), then you’d just need to apply sin(x)[sup]2[/sup] + cos(x)[sup]2[/sup] = 1 (or an equivalent equation).

---

<div class="post-metadata">

### Author: ![ultrafilter](https://avatars.discourse-cdn.com/v4/letter/u/3d9bf3/32.png) [@ultrafilter](https://boards.straightdope.com/u/ultrafilter)
#### Post date: [July 8, 2002, 3:29am UTC](https://boards.straightdope.com/t/could-someone-please-help-me-integrate-this-equation/117860/4 "2002-07-08T03:29:25Z")

</div>

Can the first one be solved? Sure, it’s a continuous function, and every continuous function is integrable.

Does it have an integral that you could write down? Well, maybe not. Actually, this one does–I’d give it to you, but I’m not sure where the parentheses go (I used [The Integrator](http://www.integrals.com), and it gave me an ambiguous answer). But not every function has a closed form integral (i.e., one that can be finitely expressed without using an integral).

---

<div class="post-metadata">

### Author: ![ShadowWarrior](https://avatars.discourse-cdn.com/v4/letter/s/7993a0/32.png) [@ShadowWarrior](https://boards.straightdope.com/u/ShadowWarrior)
#### Post date: [July 8, 2002, 10:00am UTC](https://boards.straightdope.com/t/could-someone-please-help-me-integrate-this-equation/117860/5 "2002-07-08T10:00:26Z")

</div>

I would have thought Muad’dib could use presciense(sp?) to determine the answer from a couple of hours in the future, when he’s worked it out 😃

---

<div class="post-metadata">

### Author: ![Achernar](https://avatars.discourse-cdn.com/v4/letter/a/e274bd/32.png) [@Achernar](https://boards.straightdope.com/u/Achernar)
#### Post date: [July 8, 2002, 10:17am UTC](https://boards.straightdope.com/t/could-someone-please-help-me-integrate-this-equation/117860/6 "2002-07-08T10:17:52Z")

</div>

The integrand with the tan[sup]2[/sup] simplifies to Abs(Sec(x)), right? Anyway, the other, more insidious one you won’t be seeing on a test. The Integrator that **ultrafilter** links to seems to work fine. In this case, you’d enter the input like this:

Sqrt[1+Tan]

However, it gives you nasty results with hyperbolic arctangents and imaginary numbers, all of which we hope cancel for a real result.

---

<div class="post-metadata">

### Author: ![Chronos](https://sea3.discourse-cdn.com/straightdope/user_avatar/boards.straightdope.com/chronos/32/134_2.png) [@Chronos](https://boards.straightdope.com/u/Chronos)
#### Post date: [July 8, 2002, 6:33pm UTC](https://boards.straightdope.com/t/could-someone-please-help-me-integrate-this-equation/117860/7 "2002-07-08T18:33:54Z")

</div>

Maple’s result doesn’t have any hyperbolics or explicitly complex numbers (although it does have a few log terms which might go imaginary), but it’s still pretty ugly. If you really want to know, it’s -1/4\*(-sqrt(2_sqrt(2)+2)ln(tan(x)+1+sqrt(2sqrt(2)+2)sqrt(1+tan(x))+sqrt(2))sqrt(2sqrt(2)-2)-4arctan((2_sqrt(1+tan(x))+sqrt(2_sqrt(2)+2))/(2_sqrt(2)-2)^(1/2))+sqrt(2_sqrt(2)+2)sqrt(2)ln(tan(x)+1+sqrt(2sqrt(2)+2)sqrt(1+tan(x))+sqrt(2))sqrt(2sqrt(2)-2)+sqrt(2sqrt(2)+2)ln(-tan(x)-1+sqrt(2sqrt(2)+2)sqrt(1+tan(x))-sqrt(2))sqrt(2sqrt(2)-2)+4arctan((-2sqrt(1+tan(x))+sqrt(2_sqrt(2)+2))/(2_sqrt(2)-2)^(1/2))-sqrt(2_sqrt(2)+2)\*sqrt(2)_ln(-tan(x)-1+sqrt(2_sqrt(2)+2)_sqrt(1+tan(x))-sqrt(2))sqrt(2sqrt(2)-2))/(2_sqrt(2)-2)^(1/2)

I sure as heck hope that wraps.

---

<div class="post-metadata">

### Author: ![ultrafilter](https://avatars.discourse-cdn.com/v4/letter/u/3d9bf3/32.png) [@ultrafilter](https://boards.straightdope.com/u/ultrafilter)
#### Post date: [July 8, 2002, 6:35pm UTC](https://boards.straightdope.com/t/could-someone-please-help-me-integrate-this-equation/117860/8 "2002-07-08T18:35:45Z")

</div>

Chronos, did you try simplify(%) after you got that back?

---

<div class="post-metadata">

### Author: ![g8rguy](https://avatars.discourse-cdn.com/v4/letter/g/7cd45c/32.png) [@g8rguy](https://boards.straightdope.com/u/g8rguy)
#### Post date: [July 8, 2002, 7:09pm UTC](https://boards.straightdope.com/t/could-someone-please-help-me-integrate-this-equation/117860/9 "2002-07-08T19:09:30Z")

</div>

Simplify gives you a fat lot of nothing helpful. There’s an overall factor of sqrt(2)-1 which you can pull out, and you can of course combine the logarithms, but it’s still ugly. And I have no idea how it did the integral; I’ve been sitting over in my corner perioidically trying different substitutions and getting other things that I still can’t integrate.

---

<div class="post-metadata">

### Author: ![ultrafilter](https://avatars.discourse-cdn.com/v4/letter/u/3d9bf3/32.png) [@ultrafilter](https://boards.straightdope.com/u/ultrafilter)
#### Post date: [July 8, 2002, 7:12pm UTC](https://boards.straightdope.com/t/could-someone-please-help-me-integrate-this-equation/117860/10 "2002-07-08T19:12:28Z")

</div>

There are special commands to simplify using trigonometric rules and the like. I’ll play with it once I get home, unless someone else tries it first. Of course, it’s possible that there’s nothing to be done with it, but I’d like to check.

---

<div class="post-metadata">

### Author: ![g8rguy](https://avatars.discourse-cdn.com/v4/letter/g/7cd45c/32.png) [@g8rguy](https://boards.straightdope.com/u/g8rguy)
#### Post date: [July 8, 2002, 8:11pm UTC](https://boards.straightdope.com/t/could-someone-please-help-me-integrate-this-equation/117860/11 "2002-07-08T20:11:21Z")

</div>

Eh, I’m pretty good with maple, but unless you can think of some relation for arctan(a) + arctan(b) (there may by one; I’m woeful with inverse trig functions), I’m stuck at A\*(ln(big ugly thing) + B\*(arctan(2nd big ugly thing) + arctan(3rd big ugly thing))), where A and B are some combination of sqrt(2)+1, sqrt(2)-1, and a few other things that I don’t recall off the top of my head.

---

<div class="post-metadata">

### Author: ![ultrafilter](https://avatars.discourse-cdn.com/v4/letter/u/3d9bf3/32.png) [@ultrafilter](https://boards.straightdope.com/u/ultrafilter)
#### Post date: [July 8, 2002, 11:27pm UTC](https://boards.straightdope.com/t/could-someone-please-help-me-integrate-this-equation/117860/12 "2002-07-08T23:27:37Z")

</div>

Nope, I can’t get anything either. So yeah, sqrt(1 + tan(x)) does have a closed form integrand, but I’ll be damned if I see how you’d get it.

---

<div class="post-metadata">

### Author: ![g8rguy](https://avatars.discourse-cdn.com/v4/letter/g/7cd45c/32.png) [@g8rguy](https://boards.straightdope.com/u/g8rguy)
#### Post date: [July 8, 2002, 11:41pm UTC](https://boards.straightdope.com/t/could-someone-please-help-me-integrate-this-equation/117860/13 "2002-07-08T23:41:34Z")

</div>

hmm… I tried making the simple change of variables u=-i\*x, just because I like hyperbolic functions better, and something a bit simpler popped out of maple. Alas, I forgot to post it. And I’m at home and haven’t bothered buying maple yet.

And even if I’m not hallucinating and we get something a bit nicer… I have no idea how i_sqrt(1+i_tanh(u)) is any easier. I move we leave this problem as an exercise for the reader. (I’m going to be using this phrase a lot in my career as a text book writer… “the proof is trivial and is left as an exercise to the reader.” Very handy. 🙂 )

I bet, though, that this involves some really obscure transformation like (1+ln(5u-3)) = (1+tan(x))^(17/5) or something obscene like that.

Oh, and I just thought I ought to point out that there’s no reason to worry about getting imaginary numbers anywhere, since our integrand might be pure imaginary for certain values of x.

---

<div class="post-metadata">

### Author: ![Bryan\_Ekers](https://sea3.discourse-cdn.com/straightdope/user_avatar/boards.straightdope.com/bryan_ekers/32/183_2.png) [@Bryan\_Ekers](https://boards.straightdope.com/u/Bryan_Ekers)
#### Post date: [July 9, 2002, 2:06am UTC](https://boards.straightdope.com/t/could-someone-please-help-me-integrate-this-equation/117860/14 "2002-07-09T02:06:47Z")

</div>

Chronos: -25% for not showing your work.

---

<div class="post-metadata">

### Author: ![g8rguy](https://avatars.discourse-cdn.com/v4/letter/g/7cd45c/32.png) [@g8rguy](https://boards.straightdope.com/u/g8rguy)
#### Post date: [July 10, 2002, 12:03am UTC](https://boards.straightdope.com/t/could-someone-please-help-me-integrate-this-equation/117860/15 "2002-07-10T00:03:40Z")

</div>

Right, so I figured it out on the way home from the office (I have this irritating 20 minute walk, and so I got busy thinking…).

First, make the substitution u = tan(x) to give an integrand of  
sqrt(1+u)/(1+u[sup]2[/sup]).

Next, decompose the denominator in partial fractions:  
1/(1+u[sup]2[/sup]) = i/2\*(1/(u+i) - 1/(u-i))

Make another change of variables to v = sqrt(1+u). At this point, our integrand is  
i_v[sup]2[/sup]_(1/(a[sup]2[/sup]-v[sup]2[/sup]) - 1/(b[sup]2[/sup]-v[sup]2[/sup])  
where a[sup]2[/sup] = 1+i and b[sup]2[/sup] = 1-i

Now notice that v[sup]2[/sup]/(a[sup]2[/sup]-v[sup]2[/sup]) = a[sup]2[/sup]/(a[sup]2[/sup]-v[sup]2[/sup]) - 1

Using this gives us something we can integrate:  
i\*[a[sup]2[/sup]/(a[sup]2[/sup]-v[sup]2[/sup]) - b[sup]2[/sup]/(b[sup]2[/sup]-v[sup]2[/sup])]

Both terms are elementary integrals: Int(a[sup]2[/sup]/(a[sup]2[/sup]-v[sup]2[/sup])) = a\*arctanh(v/a)

So we have, in the end  
i\*sqrt(1+i)_arctanh(v/sqrt(1+i)) - i_sqrt(1-i)\*arctanh(v/sqrt(1-i))

and substituting in v = sqrt(1+u) = sqrt(1+tan(x)) gives the final answer:  
i\*sqrt(1+i)_arctanh(sqrt((1+tan(x))/(1+i))) - i_sqrt(1-i)_arctanh  
(sqrt((1+tan(x))/(1-i)))  
Spending a whole lot of time with arctanh(x) = 1/2_log((1+x)/(1-x)) and various other identities should eventually give the same answer as maple gets, since my answer **does** work out to be correct.

_not holding breath waiting for congratulations and awe from the SDMB, as this was a truly truly pathetic way to spend 30 minutes, but oh well_

---

<div class="post-metadata">

### Author: ![ultrafilter](https://avatars.discourse-cdn.com/v4/letter/u/3d9bf3/32.png) [@ultrafilter](https://boards.straightdope.com/u/ultrafilter)
#### Post date: [July 10, 2002, 12:09am UTC](https://boards.straightdope.com/t/could-someone-please-help-me-integrate-this-equation/117860/16 "2002-07-10T00:09:15Z")

</div>

Congratulations, awe, and all that.
