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.
Okay, so if $u(x)$ solves the first boundary value problem, then can we sub $h(x)$ in to give $\hat{u}(x)=u(x) + \frac{(b-x)\alpha}{(b-a)} + \frac{(a-x)\beta}{(a-b)}$?
$\hat{u}(a)= 0 + \alpha + 0 = \alpha$, $\hat{u}(b) = 0 + 0 + \beta$... I guess I'm still a little confused.. What effect would that have on $f(x)$? Is this the correct approach?
– Swayy Apr 14 '13 at 21:21