
Wave equations
First, please forgive the poor notation used here as LaTeX does not seem to be working properly for the time being (http://www.mathhelpforum.com/mathhelp/f47/workinglatexissues1783192.html)?
This is a problem from "Elementary Differential Equations and Boundary Value Problems" by Boyce and DiPrima. Problem 10.7.1, one that should be trivial, I assume.
"Consider an elastic string of length L whose ends are held fixed. The string is set in motion with no initial velocity from an initial position u(x, 0) = f(x). Find the displacement u(x, t) for the given initial position f(x)."
f(x) = (2x)/L when 0 <= 0 <= L/2
f(x) = (2(Lx))/L when L/2 < x <= L
I eventually arrive at c_n = (2/L) * definite integral from 0 to L of (f(x) * sin((n*pi*x)/L)) dx
c_n = (2/L) * definite integral from 0 to L/2 of (((2x)/L * sin((n*pi*x)/L)) dx + (2/L) * definite integral from L/2 to L of ((2(Lx)/L) * sin((n*pi*x)/L)) dx)
How should I go about evaluating these integrals? I believe it has something to do with odd and even functions?
From the Student Solutions Manual I see they arrive at the same c_n prior to evaluating the integrals, and after they have evaluated them (this step is not elaborated at all) they arrive at:
c_n = (8/(n^2 * pi^2)*sin((n*pi)/2)

Your setup is correct.
You need to use integration by parts.
$\displaystyle \frac{2}{L}\int_{0}^{\frac{L}{2}} \frac{2x}{L}\sin\left( \frac{n \pi x}{L}\right)dx=\frac{4}{L^2}\int_{0}^{\frac{L}{2}} x\sin\left( \frac{n \pi x}{L}\right)dx$
$\displaystyle u=x \implies du=dx \quad dv=\sin\left( \frac{n \pi x}{L}\right) \implies v=\left( \frac{L}{n \pi}\right)\cos\left( \frac{n \pi x}{L}\right)$
$\displaystyle \frac{4}{L^2}\left( x\cdot\left( \frac{L}{n \pi}\right)\cos\left( \frac{n \pi x}{L}\right) \right)\bigg_{0}^{\frac{L}{2}}+\int_{0}^{\frac{L} {2}}\left( \frac{L}{n \pi}\right)\cos\left( \frac{n \pi x}{L}\right)dx=$
Now do the same thing to the other integral and simplify.