Numerical analysis - boundary value problem So I need a push in the right direction with this question, so any help is much appreciated :)
Show that the solution to the boundary value problem 
$-u''(x) + r(x)u(x) = f(x)$, $u(a)=\alpha$, $u(b)=\beta$
where $r(x) \gt 0$ for all $x \in [a, b]$, is the same as the solution to the boundary value problem 
$-u''(x) + r(x)u(x) = g(x), u(a) = 0, u(b)= 0$ for a suitable function $g(x).$
Do I need to use the Finite Element Method here or is there a different way of doing this?
 A: There's no complicated argument to be used here, you are just asked to choose $g(x)$ to remove the boundary conditions on $u(x)$.
Since $u(a)=u(b)=0$ is different to $u(a)=\alpha,u(b)=\beta$ the two functions are different, so suppose $\hat{u}(x) = u(x) + h(x)$ for some $h(x)$. How can we choose $h(x)$ to make the boundary conditions go away? We can make a fairly simple choice for convenience. (Hint: Two points define a ...?)
Then, what effect does this have on $f(x)$? This tells us what $g(x)$ should be.

Suppose that $\hat{u}$ is given by $$\hat{u}(x) = u(x) + \frac{b-x}{b-a}\alpha + \frac{b-x}{a-x}\beta$$so that $\hat{u}(a) = \alpha + u(a)$ and $\hat{u}(b) = \beta + u(b)$. Then our original problem (with $\alpha,\beta$) is going to be solved by $\hat{u}$ if $u(a)=u(b)=0$ and if $u(x)$ is chosen such that the equation
$$-\hat{u}'' + r \hat{u} = f$$
holds.
What does this mean for $u(x)$? Let's substitute in:
$$-(u + \cdots)'' + r \left(u + \frac{b-x}{b-a}\alpha + \frac{b-x}{a-x}\beta\right) = f$$
I've left the $\cdots$ in because the stuff we add is linear in $x$, so the double derivative kills it. But now take the added things over to the right-hand side:
$$-u'' + ru = f - r\times \left(\frac{b-x}{b-a}\alpha + \frac{b-x}{a-x}\beta\right) \equiv g$$
where we have defined $g$ on the right-hand side.
So solving the earlier equation is just as easy as solving the new equation! We just need to add on our $\hat{u} - u$ bit afterwards.
