# Analyitical solution to function and second deritive of function

1. Jun 13, 2012

### munkifisht

I have the following (fairly simple) boundary value problem and I am trying to find an analytical solution to it, but for the life of me it's not working out. This is part of a larger thing where I'm trying to understand FEM and BVPs. Essentially this is a diffusion reaction problem.

My problem is I have the following (π=pi)

v-kv''=f(x)=sin(πx), x is between 1 and 2
v@x=0 = 0 and v@x=1 = 0

I have some plots but they are not matching my analytical solution (I think my brain has just broken tonight), but if anyone can steer me right I'd be grateful.

2. Jun 13, 2012

### munkifisht

I should also have mentioned k is a constant

3. Jun 13, 2012

### HallsofIvy

Staff Emeritus
The differential equation is $-kv''+ v= sin(\pi x)$? That's a linear equation with constant coefficents. Its characteristic equation is $-kr^2+ 1= 0$ so that $r= \pm 1$ and the general solution is $C_1e^x+ C_2e^{-x}$ (it could also be written as $C_1cosh(x)+ C_2sinh(x)$).

Look for a specific solution to the entire equation of the form $Asin(\pi x)+ B cos(\pi x)$.

But I am concerned about the information that the differential equation only holds between x= 1 and x= 2, so that the previous solution is valid only between x= 1 and x= 2, while we are given the value of v at x= 0. Not knowing what v is like between 0 and 1, it is impossible to use that information. I suggest you recheck that- either the d.e. holds between 0 and 1 or the boundary values are given at 1 and 2.

4. Jun 14, 2012

### munkifisht

#sorry, mistake on my part, yes, the equation holds between 0 and 1. Thanks for that, so rusty on differential calculus