# Taking the integral of a strange function.

This is my second question on the exchange. I've been wrestling with this particular problem for several weeks now, ever since I discovered a certain function, which I call the 'grum' function. I don't know if it's ever been discovered before. I'm just doing street math, pretty much.

In any case, the grum function gives the answer to the following question:

Given any right triangle, and any line segment connecting:

• The vertice of the angle opposite the hypotenuse, and:
• Any point p resting on the hypotenuse, where the distance between the point p and the adjacent vertices of the triangle is given as the following ratio:
• $d_{1} = \frac{r}{n}$
• $d_{2} = r - \frac{r}{n}$

The distance of said line segment can be found via the following function:

$$grum_{n}(\theta) \equiv n^{-1}\sqrt{(n-1)^{2}\cos^{2}(\theta) + sin^{2}(\theta)}$$

pronounced "grum with index 'n' and evaluated at 'theta'". The proof is fairly simple, and involves a geometric argument involving right triangles inscribed within right triangles, but that's not relevant to the question at the moment. Although, if you guys do want the proof, then I'll provide it.

In any case, however, my problem revolves around taking the indefinite integral of this function. I can take the derivative of grum with respect to theta like so:

$$\frac{d}{d\theta} n^{-1}\sqrt{(n-1)^{2}\cos^{2}(\theta) + \sin^{2}(\theta)}$$ $$\frac{-2(n-1)^{2}\cos(\theta)\sin(\theta) + 2\sin(\theta)\cos(\theta)}{2n\sqrt{(n-1)^{2}\cos^{2}(\theta) + \sin^{2}(\theta)}}$$

Which, if we multiply the denominator by 'n' and then simplify the expression, we get the nifty equation of:

$$\frac{d}{d\theta} grum_{n}(\theta) \equiv \frac{\sin(2\theta)(1 - (n-1)^{2})}{2n^{2}grum_{n}(\theta)}$$

So far, so good! However, I got stuck when I tried to take the indefinite integral of this function. I really want to learn not just what the indefinite integral is, but how to get it, and why it works. In any case, here's what I've gotten so far.

First, I draw out the constant in front of the radical, and rewrite the exponents.

$$n^{-1}\lmoustache ((n-1)^{2}\cos^{2}(\theta) + \sin^{2}(\theta))^{\frac{1}{2}}d\theta$$

Next, I rewrite $\sin^{2}(\theta)$ in the form of $1 - \cos^{2}$ and simplify the expression, which yields:

$$n^{-1}\lmoustache((n-1)^{2}\cos^{2}(\theta) - \cos^{2}(\theta) + 1)^{\frac{1}{2}}d\theta$$ $$n^{-1}\lmoustache(\cos^{2}(\theta)((n-1)^{2} - 1)) + 1)^{\frac{1}{2}}d\theta$$

Then I use the trig substitution identity $\sqrt{a^{2} + b^{2}x^{2}} = \frac{a}{b}\tan(x)$ to get the following form:

$$\frac{1}{n\sqrt{((n-1)^{2}-1) + 1)}}\lmoustache\tan(cos^{2}(\theta))d\theta$$

And... here's where I get stuck. How in hell does one calculate the indefinite integral of $\tan(cos^{2}(\theta))$? Am I even doing this the right way? In using the trigonometric substitution, I simply inserted $\cos^{2}(\theta)$ where x would have gone, but there's no guarantee that that's a valid operation.

If I could get some guidance, or even just a push in the right direction, I would be grateful. In the meantime, I'll keep working on it, and let you guys know if I make any progress on it.

Sorry for the long question, haha. I hope it was at least interesting in some small way, and I thank you very much for your time.

Thank you very much,

sincerely,

Druid.

• You can directly integrate your function in Wolfram Alpha. Unfortunately, the integral is elliptic, so it looks like there's no closed form for your integral: wolframalpha.com/input/?i=Integrate%5BSqrt%5B%28n-1%29%5E2*Sin%5Bx%5D%5E2%2BCos%5Bx%5D%5E2%5D%2Cx%5D – Alex R. Feb 10 '15 at 0:12
• I see. I don't know what an elliptic integral is, but that definitely gives me a path to follow. Let me look into it. Thank you very much, Alex! – Druid Feb 10 '15 at 0:18
• Woah. This is some deep stuff(although stuff might not be the word I'd use, haha). I'm going to mark the question as solved, as I have a feeling it's not a simple answer. I'm going to need to do some serious research on it. Thanks, Alex. – Druid Feb 10 '15 at 0:33
• Oops. Forgot to mark it as solved. – Druid Feb 10 '15 at 2:15
• Oh, wait. You weren't supplying an answer, but just giving a comment? In that case... never mind! haha. my bad. – Druid Feb 10 '15 at 2:16

$$\int \sqrt{(n-1)^{2}\cos^{2}(\theta) + \sin^{2}(\theta)} \space d\theta$$ is a known integral called "elliptic integral of the second kind" : http://mathworld.wolfram.com/EllipticIntegraloftheSecondKind.html
In the present case, the symbol used for the convenient special function is E$(x,k)$ or alternatively E$(x | m)$ with $m=k^2$ (which is a bit confusing). $$\int \sqrt{(n-1)^{2}\cos^{2}(\theta) + \sin^{2}(\theta)} \space d\theta=(n-1)\text{E}(\theta | m)+constant$$ $$m=\frac{n(n-2)}{(n-1)^2}$$