# Linear shooting method for Second Order BVP

How can we use the linear shooting method to solve the boundary value problem $$y'' = 2y' - y, ~y(0) = 1, \text{and} ~~y(1) = 2?$$

I tried to convert it to a first order system, but didn't get what I needed.

• Can you show more of your work? – Ataraxia May 12 '13 at 20:01
• Do you have to use the shooting method, or to convert into a system? It's easy to just write down the general solution of $y''-2y'+y=0$ and them solve for the constants same way as we do with IVP. It's actually easier than with IVP, because you don't have to take derivatives here. – 75064 May 12 '13 at 20:14

Hints:

We are given:

$$\tag 1 \displaystyle y'' = 2y' - y, ~y(0) = 1, \text{and} ~~y(1) = 2$$

We know that if the linear boundary-value problem:

$y'' = p(x)y' + q(x)y+r(x), a \le x \le b, y(a) = \alpha, y(b) = \beta$, satisfies:

(i) $p(x), q(x)$, and $r(x)$ are continuous on $[a, b]$

(ii) $q(x) \gt 0$ on $[a, b].$

We can get a unique solution.

For this problem, we have:

$y_1(x): y'' = p(x) y' + q(x) y + r(x)$, and

$y_2(x): y'' = p(x) y' + q(x) y$

So,

• $p(x) = 2$
• $q(x) = -1$
• $r(x) = 0$

With the same BCs given in $(1)$.

For comparison purposes, $(1)$ has the exact solution:

$$\displaystyle y(x) = e^{x-1} \left(-e x+2 x+e\right)$$

Now, you just have to apply all of the above to the Linear Shooting Algorithm.

Note, did they provide an "N" for how many steps they wanted because $\displaystyle h = \frac{b-a}{N}$?

Also note, this algorithm is pretty involved and it is easier to code it up rather than manually cranking values.

• I need to know how to do it by hand, not a computer. This was a practice question for the final. Could you please fill in the detail? – Richard Wang May 12 '13 at 20:50
• It is okay if you do it by hand, but what do you suppose is going to get you to learn how to do it by hand? It is coding up the algorithm. This lets you manually crank by hand, while at the same time letting you print out all of the values. This is how you will learn to do it! See youtube.com/watch?v=ZMgikZ-lcS8 for a tutorial. Also, wasn't this reviewed in class? The question is no longer a math question, but an algorithm question. Regards – Amzoti May 12 '13 at 20:55
• Nice job! Every step of the way +1 – Namaste May 13 '13 at 0:21

Characteristic equation of $$y''-2y+y = 0$$ is $$\lambda^2 - 2\lambda+1 = 0 \\ \lambda_{1,2} = 1$$ so general solution can be found as $$y = e^x(C_1 + C_2 x)$$ To find unknown coefficients one can use boundary conditions $$y(0) = C_1 = 1 \\ y(1) = e(1+C_2) = 2 \\ C_2 = \frac 2e-1$$ And finally $$y(x) = e^x \left [1 + x \left( \frac 2e-1\right) \right ]$$