- #1
roldy
- 237
- 2
Homework Statement
Consider the differential equation
[tex]-\frac{d^2u}{dx^2}=cos\pi x[/tex] for 0<x<1
subject to the boundary condition
u(0)=0, u(1)=0
Determine a three-parameter solution, with trigonometric functions the least-squares method
Given: [tex]u=\phi_0 + c_1\phi_1 + c_2\phi_2 + c_3\phi_3[/tex]
[tex]\phi_0=0, \phi_1=sin\pi x, \phi_2=sin2\pi x, \phi_3=sin3\pi x[/tex]
Homework Equations
1st and 2nd derivatives of u with respect to x
Derivative of R with respect to ci
[tex]0=\int_0^1R\frac{\partial R}{\partial c_i}dx[/tex]
The Attempt at a Solution
[tex]u=c_1sin\pi x + c_2sin2\pi x + c_3sin3\pi x=\Sigma_{i=1}^n c_isin(i\pi x)[/tex]
[tex]\frac{d^2u}{dx^2}=-\Sigma_{i=1}^n c_i(i\pi)^2sin(i\pi x)[/tex]
and
[tex]\frac{\partial R}{\partial c_i}=(i\pi)^2sin(i\pi x)[/tex]
so then,
[tex]R=-\frac{d^2u}{dx^2}-cos(\pi x)=\Sigma_{i=1}^n c_i(i\pi)^2sin(i\pi x)-cos(\pi x)[/tex]
[tex]0=\int_0^1R\frac{\partial R}{\partial c_i}dx=\int_0^1\left[\Sigma_{i=1}^n c_i(i\pi)^2sin(i\pi x)-cos(\pi x)\right]\left[(i\pi)^2sin(i\pi x)\right]dx[/tex]
The term,
[tex](i\pi)^2[/tex] is dropped out because it's just a multiplicative factor.
So then I arrive here, at which point I'm stuck
[tex]0=\int_0^1\left[\Sigma_{i=1}^n c_i(i\pi)^2sin(i\pi x)-cos(\pi x)\right]sin(i\pi x)dx[/tex]
I know that I need to somehow get [tex]c_1, c_2, c_3[/tex]
If I integrate the above integral across the summation, I'll end up with one equation with the three constants.
I would think that I need three equations. Do I perform the summation from i=1,2,3 and then integrate, which would give me one equation, or do I integrate and then do the summation? If I remember correctly I can take the summation out before the integral. Is this correct?