Integration by parts with orthogonality relation

FatPhysicsBoy
Messages
62
Reaction score
0

Homework Statement



I want to integrate \int_{0}^{a} xsin\frac{\pi x}{a}sin\frac{\pi x}{a}dx

Homework Equations



I have the orthogonality relation:

\int_{0}^{a} sin\frac{n\pi x}{a}sin\frac{m\pi x}{a}dx = \begin{cases} \frac{a}{2} &amp;\mbox{if } n = m; \\ <br /> 0 &amp; \mbox{otherwise.} \end{cases}

and the parts formula:
\int u \, dv=uv-\int v \, du

The Attempt at a Solution



I took u = x, and dv = sin\frac{n\pi x}{a}sin\frac{m\pi x}{a}. Following the parts formula I get a final answer of \frac{a^{2}}{2} - \frac{a^{2}}{2} = 0. However, this is incorrect. The correct answer for the integral is \frac{a^{2}}{4}.

I know how to do this using a trigonometric identity to swap out the sin^{2}x term for a linear term involving cos2x, but I don't quite understand why this method doesn't work. I think it has something to do with linearity but I don't fully understand why one method works and the other doesn't.
 
Last edited:
Physics news on Phys.org
FatPhysicsBoy said:

Homework Statement



I want to integrate \int_{0}^{a} xsin\frac{\pi x}{a}sin\frac{\pi x}{a}dx
This is the same as
$$ \int_{0}^{a} xsin^2(\frac{\pi x}{a})dx$$

An easier way to integrate this is to use a trig double angle formula.
FatPhysicsBoy said:

Homework Equations



I have the orthogonality relation:

\int_{0}^{a} sin\frac{n\pi x}{a}sin\frac{m\pi x}{a}dx = \begin{cases} \frac{a}{2} &amp;\mbox{if } n = m; \\ <br /> 0 &amp; \mbox{otherwise.} \end{cases}

and the parts formula:
\int u \, dv=uv-\int v \, du

The Attempt at a Solution



I took u = x, and dv = sin\frac{n\pi x}{a}sin\frac{m\pi x}{a}. Following the parts formula I get a final answer of \frac{a^{2}}{2} - \frac{a^{2}}{2} = 0. However, this is incorrect. The correct answer for the integral is \frac{a^{2}}{4}.

I know how to do this using a trigonometric identity to swap out the sin^{2}x term for a linear term involving cos2x, but I don't quite understand why this method doesn't work. I think it has something to do with linearity but I don't fully understand why one method works and the other doesn't.
 
FatPhysicsBoy said:

Homework Statement



I want to integrate \int_{0}^{a} xsin\frac{\pi x}{a}sin\frac{\pi x}{a}dx

Homework Equations



I have the orthogonality relation:

\int_{0}^{a} sin\frac{n\pi x}{a}sin\frac{m\pi x}{a}dx = \left \{ \begin{matrix}<br /> \frac{a}{2} \text{, if \textit{n = m};}\\ <br /> 0 \text{, otherwise.}<br /> \end{matrix}\right.

If you have a "\left", you need a matching "\right". "\right." is necessary if you don't want a closing symbol. But this sort of thing is best done using "\begin{cases}":
Code:
I(n,m)  = \begin{cases} \frac{a}{2}, & \mbox{if $n = m$}, \\[1em]
0 & \mbox{else} \end{cases}
gives
<br /> I(n,m) = \begin{cases} \frac{a}{2}, &amp; \mbox{if $n = m$} \\[1em]<br /> 0 &amp; \mbox{else} \end{cases}

and the parts formula:
\int u \, dv=uv-\int v \, du

The Attempt at a Solution



I took u = x, and dv = sin\frac{n\pi x}{a}sin\frac{m\pi x}{a}. Following the parts formula I get a final answer of \frac{a^{2}}{2} - \frac{a^{2}}{2} = 0. However, this is incorrect. The correct answer for the integral is \frac{a^{2}}{4}.

I know how to do this using a trigonometric identity to swap out the sin^{2}x term for a linear term involving cos2x, but I don't quite understand why this method doesn't work. I think it has something to do with linearity but I don't fully understand why one method works and the other doesn't.

If dv = \sin(\pi x/a)\sin(\pi x/a) then
<br /> v = \int \sin(\pi x/a)\sin(\pi x/a)\,dx.<br /> The integral is indefinite, not a definite integral from 0 to a, so you can't use the orthogonality relation to evaluate it.
 
pasmith said:
If you have a "\left", you need a matching "\right". "\right." is necessary if you don't want a closing symbol. But this sort of thing is best done using "\begin{cases}":
Code:
I(n,m)  = \begin{cases} \frac{a}{2}, & \mbox{if $n = m$}, \\[1em]
0 & \mbox{else} \end{cases}
gives
<br /> I(n,m) = \begin{cases} \frac{a}{2}, &amp; \mbox{if $n = m$} \\[1em]<br /> 0 &amp; \mbox{else} \end{cases}



If dv = \sin(\pi x/a)\sin(\pi x/a) then
<br /> v = \int \sin(\pi x/a)\sin(\pi x/a)\,dx.<br /> The integral is indefinite, not a definite integral from 0 to a, so you can't use the orthogonality relation to evaluate it.

Thanks for that, I managed to get it sorted in the end, I hit 'Submit Reply' by accident instead of 'Preview Post'.

I suppose that does make sense when I consider all the other instances where I've used product rule. We never evaluate the v integrand definitely. If the integral is always indefinite then why don't we have constants of integration floating about when we do integration by parts?
 
There isn't a need to use integration by parts. You can easily solve this by using the properties of definite integral.

Let:
$$I=\int_0^a x\sin^2\left( \frac{\pi x}{a}\right)\,dx$$
The above is same as:
$$I=\int_0^a (a-x)\sin^2\left( \frac{\pi x}{a}\right)\,dx$$
Add the two expressions for ##I## to get:
$$2I=\int_0^a a\sin^2\left( \frac{\pi x}{a}\right)\,dx$$
Use the orthogonality relation you posted to get the required answer.
 
FatPhysicsBoy said:
I suppose that does make sense when I consider all the other instances where I've used product rule. We never evaluate the v integrand definitely. If the integral is always indefinite then why don't we have constants of integration floating about when we do integration by parts?

We don't need them. If C is a constant then (v(x) +C)&#039; = v&#039;(x) and
<br /> \int u(x)v&#039;(x)\,dx = u(x)(v(x) + C) - \int u&#039;(x)(v(x) + C)\,dx \\<br /> = u(x)v(x) + Cu(x) - \int u&#039;(x)v(x)\,dx - \int Cu&#039;(x)\,dx \\<br /> = u(x)v(x) - \int u&#039;(x)v(x)\,dx + C\left( u(x) - \int u&#039;(x)\,dx\right) \\<br /> = u(x)v(x) - \int u&#039;(x)v(x)\,dx + C\left( u(x) - (u(x) + D)\right) \\<br /> = u(x)v(x) - \int u&#039;(x)v(x)\,dx - CD<br /> and we can combine -CD with the constant we get from integrating u&#039;v.
 
  • Like
Likes 1 person
FatPhysicsBoy said:

Homework Equations



I have the orthogonality relation:

\int_{0}^{a} sin\frac{n\pi x}{a}sin\frac{m\pi x}{a}dx = \begin{cases} \frac{a}{2} &amp;\mbox{if } n = m; \\ <br /> 0 &amp; \mbox{otherwise.} \end{cases}

and the parts formula:
\int u \, dv=uv-\int v \, du

You're answer is wrong because \int_{0}^{a} sin\frac{n\pi x}{a}sin\frac{m\pi x}{a}dx = \begin{cases} \frac{x}{2} &amp;\mbox{if } n = m; \\ <br /> 0 &amp; \mbox{otherwise.} \end{cases}

The \frac{a}{2} is after evaluation of the integral from 0 to a. So your \intvdu is actually \int\frac{x}{2}dx.
 
  • Like
Likes 1 person
Back
Top