# Integrating sine and cosine with respect to the triangle legs?

Consider a circle centered at the origin of the $$x$$-$$y$$ plane with radius $$R.$$ Then:

$$\sin \theta = \frac{y}{R}$$

But say I want to take an integral using this relationship.

$$\int\sin \theta \, d\theta$$

Substituting

$$\int \frac{y}{R} \, d\theta$$

There is no theta anymore to take the integral with respect to. Does this then become?

$$\int\frac{y}{\sqrt{x^2+y^2}} \, dy$$

But when I integrate I get

$$\sqrt{x^2+y^2} + c$$

which doesn't look like cosine of anything. What am I missing?

• Look up how to do u-substitution. Nov 7 '19 at 4:52
• @SeanRoberson I used u-substitution to evaluate the proposed integral. It's just that the result doesn't seem to resemble the integral of sine. Now perhaps we need to integrate this intermediate result, but the result of sqrt(x^2 + y^2) dx is truly nasty. And again, not the integral of sine. Nov 7 '19 at 5:09

What you're missing is that $$d\theta$$ is not $$dy.$$

One could say that $$R\,d\theta = \sqrt{(dx)^2+(dy)^2\,},$$ i.e. an infinitesimal increment of arc length is the square root of the sum of the squares of the corresponding infinitesimal increments of $$x$$ and $$y.$$ And since $$x^2 + y^2 = R^2,$$ you have $$x\,dx+y\,dy = 0,$$ so $$dx = - \frac{y\,dy} x = - \frac{y\, dy}{\sqrt{R^2-y^2}}.$$ Thus $$\int \frac y R \, d\theta = \int \frac y R \sqrt{\left(\frac{y^2(dy)^2}{R^2 - y^2} \right) + (dy)^2} = \int \frac y {\sqrt{R^2-y^2}} \, dy.$$

• Ah okay, I follow that. But if we continue... R^2 = x^2 + y^2, so the denominator simplifies to x. Which we can then pull out of the integral. Straightforward integration leaves us with c + y^2 / 2x. Which I'm not really sure how to interpret. I still don't see cosine. Nov 7 '19 at 5:25
• I think there is a factor missing in the $d\theta$ expression, am I correct?
– dfnu
Nov 7 '19 at 12:33

As already pointed out by Michael, you first need to take into consideration the correct increment of arc length $$d\theta$$, and express it as a function of the increment of the $$y$$-coordinate.

Since, (CAREFUL: for $$-\frac{\pi}2\leq \theta \leq \frac{\pi}2$$),

$$\theta(y) = \arcsin\frac{y}{R},$$ we have, by taking derivative, $$\frac{d\theta(y)}{dy}= \frac{R}{\sqrt{R^2-y^2}}\frac1{R}=\frac1{\sqrt{R^2-y^2}}.$$

Now you are ready to compute your integral with respect to $$y$$, i.e. $$\begin{eqnarray} \mathcal I &=& \int\sin \theta\ d\theta=\\ &=&\int\frac{y}{R}\frac{1}{\sqrt{R^2-y^2}}\ dy=\\ &=&-\frac{\sqrt{R^2-y^2}}{R}+C. \end{eqnarray}$$ Now recall that $$y = R\sin\theta$$ and obtain $$\mathcal I =-\frac{R\sqrt{1-\sin^2\theta}}{R}+C=-|\cos\theta|+C.$$

Our replacement was valid for $$-\frac{\pi}2\leq \theta\leq \frac{\pi}2$$, where the cosine is positive. So we have in the end $$\mathcal I = -\cos\theta + C,$$ as expected.

As a further exercise for you, I suggest working out also the case $$\frac{\pi}2\leq \theta\leq \frac{3\pi}2$$.

A sidenote on your comment to Michael's answer: if you replace $$R^2 = x^2+y^2$$, you must take into account that $$x$$ is actually a function of $$y$$, and not a constant. So your proposed integration is not correct.