Solving 2nd order with boundary conditions

108 Views Asked by At

$$f''+\lambda f = 0, \quad f=f(y), \quad a \leq y \leq b, \quad f(a)=f(b)=0 $$

In this case, I tried

$$f(y)=sin(k_ny), \quad \lambda=k_n^2 $$ $$f(a)=0 \Longrightarrow k_na = n\pi, \quad n=0,1,2,...$$ $$ k_n=\frac{n\pi}{a}, \quad n=0,1,2,... $$

The problem is that I don't know how to apply the second boundary condition here, so I know something in my approach is wrong. The answer is stated below. I can see why this solution works, but I just don't know how to derive it myself. Also I'm wondering if there is a solution that works from $n=0$.

$$ f(y)=sin(k_n(y-a)), \quad k_n=\frac{n\pi}{b-a}, \quad n=1,2,... $$

EDIT: I tried setting $$ f(y) = Acos(k_ny) + Bsin(k_ny) $$ $$ f(a) = Acos(k_na) + Bsin(k_na) = 0 $$ $$ f(b) = Acos(k_nb) + Bsin(k_nb) = 0 $$

But I'm not sure where to go from here. $f(a)$ can be zero if $A=-B, k_na = \pi/4 + n\pi$, but it can also be zero if $A=0, k_na=n\pi$ or $B=0, k_na=\pi/2+n\pi$. Do I have to check the second condition for all these 3 solutions, or is there any way to know which one I should go with?

2

There are 2 best solutions below

4
On BEST ANSWER

Assuming $\lambda>0$, the general solution is

$$f(y)=c_c\cos(\sqrt\lambda y)+c_s\sin(\sqrt\lambda y).$$

Plugging the boundary conditions,

$$0=c_c\cos(\sqrt\lambda a)+c_s\sin(\sqrt\lambda a), \\0=c_c\cos(\sqrt\lambda b)+c_s\sin(\sqrt\lambda b).$$

The determinant of this homogeneous linear system is

$$\sin(\sqrt\lambda(b-a)).$$

So

  • if $\sqrt\lambda(b-a)$ is not a multiple of $\pi$, only the trivial solution $f=0$ is possible;

  • if $\sqrt\lambda(b-a)$ is a multiple of $\pi$, the solutions are

$$c\sin(\sqrt\lambda(x-a))$$ where $c$ is free.

4
On

Hint: Solve the related problem

$$ f''(x) + \lambda f(x) = 0, \quad 0 \le x \le 1, \quad f(0)=f(1)=0 $$

Then make the coordinate transform $y = a + (b-a)x $

Edit: You can think about the transform organically. The general solution is

$$ f(y) = A\cos(\sqrt{\lambda}y) + B\sin(\sqrt{\lambda}y) \tag{1} $$

This would be very convenient if one of the B.C.s was at $x=0$ since you have $f(0) = A$ and $f'(0)=\sqrt{\lambda}B$. Since this is not the case, you can try to see what would happen if the solution was shifted to $x=a$ instead

$$ f(y) = \widetilde{A}\cos(\sqrt{\lambda}(y-a)) + \widetilde{B}\sin(\sqrt{\lambda}(y-a)) \tag{2} $$

This is also a solution of the ODE since the operation $f''$ is shift-invariant, and the shifted sinusoids are still a linear combination of the original $\sin$ and $\cos$ functions.

Using $(2)$ as the solution form gives $\widetilde{A} = 0$ and $\sqrt{\lambda} = \dfrac{n\pi}{b-a}$.

Edit 2: I will expand on Yves' answer further to show how you can arrive at the same answer

Using $(1)$ as the solution form, we need to solve

\begin{align} A\cos(\sqrt{\lambda}a) + B\sin(\sqrt{\lambda}a) &= 0 \\ A\cos(\sqrt{\lambda}b) + B\sin(\sqrt{\lambda}b) &= 0 \end{align}

We'll get a non-trivial solution if the determinant of this system is $0$. Another way to understand this without using the determinant is to solve the system normally. Find $B$ in terms of $A$ in the second equation and plug it into the first, you get

$$ A\cos(\sqrt{\lambda}a) - A\frac{\cos(\sqrt{\lambda}b)}{\sin(\sqrt{\lambda}b)}\sin(\sqrt{\lambda}a) = 0 $$

$$ \implies A\big[\cos(\sqrt{\lambda}a)\sin(\sqrt{\lambda}b) - \cos(\sqrt{\lambda}b)\sin(\sqrt{\lambda}a)\big] = A\sin(\sqrt{\lambda}(b-a)) = 0 $$

We can't have $A=0$, so we require

$$ \sin\sqrt{\lambda}(b-a) = 0 \implies \sqrt{\lambda}(b-a) = n\pi $$

where $n=1,2,3,\dots$, $n$ can't be $0$ here since it would also give a trivial solution (you should've excluded the cases $\lambda=0$ and $\lambda < 0$ earlier on)

Now, $A$ and $B$ form a family of solutions satisfying

$$ \frac{A}{B} = -\frac{\sin(\sqrt{\lambda}a)}{\cos(\sqrt{\lambda}a)} = -\frac{\sin(\sqrt{\lambda}b)}{\cos(\sqrt{\lambda}b)} $$

we can arbitrarily set $A = -c\sin(\sqrt{\lambda}a)$, $B=c\cos(\sqrt{\lambda}a)$ (which is fine since we know the final solution still has one free constant). Thus

$$ f(y) = -c\sin(\sqrt{\lambda}a)\cos(\sqrt{\lambda}y) + c\cos(\sqrt{\lambda}a)\sin(\sqrt{\lambda}y) = c\sin(\sqrt{\lambda}(y-a)) $$