I'm attempting to solve the following ODE using Matlab's built-in function dsolve
$$\frac{d^4w}{dx^4}=w$$ with the following boundary conditions: \begin{align} \frac{dw}{dx}(0)&=0\\ \frac{d^3w}{dx^3}(0)&=0\\ \frac{d^2w}{dx^2}(L)&=0\\ \frac{d^3w}{dx^3}(L)&=0 \end{align}
I first tried to use the following code
syms w(x)
a = 1;
L = 1;
Dw = diff(w,1);
D2w = diff(w,2);
D3w = diff(w,3);
w = dsolve(diff(w,4) - a*w == 0, Dw(0) == 0, D3w(0) == 0,D2w(L) == 0, D3w(L) == 0)
But, this only lead to the trivial solution $u=0$, which I think was due to having the boundary condition $\frac{dw}{dx}(0)=0$. I tried to remedy this by setting the zero boundary conditions equal to $eps == 2.2204e-16$, which for all practically purposes is equal to zero.
I did get a nontrivial solution which solved the ODE, but I want to see if this is a reasonable approach to match the boundary condition.
Thanks for any feedback, and sorry for the poor Matlab code formatting!
$$\frac{d^4w}{dx^4}=w$$ Obviously, $e^x$ , $e^{-x}$ , $e^{ix} , e^{-ix}$ are independent particular solutions. So, the general solution can be expressed with linear combinations of them, for example : $$w=c_1\cosh(x)+c_2\sinh(x)+c_3\cos(x)+c_4\sin(x)$$ $$\frac{dw}{dx}=c_1\sinh(x)+c_2\cosh(x)-c_3\sin(x)+c_4\cos(x)$$ $$\frac{d^2w}{dx^2}=c_1\cosh(x)+c_2\sinh(x)-c_3\cos(x)-c_4\sin(x)$$ $$\frac{d^3w}{dx^3}=c_1\sinh(x)+c_2\cosh(x)+c_3\sin(x)-c_4\cos(x)$$
The conditions are : $$\begin{cases} \left(\frac{dw}{dx}\right)_{x=0}=c_2+c_4=0\\ \left(\frac{d^3w}{dx^3}\right)_{x=0}=c_2-c_4=0\\ \left(\frac{d^2w}{dx^2}\right)_{x=L}=c_1\cosh(L)+c_2\sinh(L)-c_3\cos(L)-c_4\sin(L)=0\\ \left(\frac{d^3w}{dx^3}\right)_{x=L}=c_1\sinh(L)+c_2\cosh(L)+c_3\sin(L)-c_4\cos(L)=0 \end{cases}$$
$$\begin{cases} c_2=0\\ c_4=0\\ \left(\frac{d^2w}{dx^2}\right)_{x=L}=c_1\cosh(L)-c_3\cos(L)=0\\ \left(\frac{d^3w}{dx^3}\right)_{x=L}=c_1\sinh(L)+c_3\sin(L)=0 \end{cases}$$ $$\frac{c_1}{c_3}=\frac{\cos(L)}{\cosh(L)}=-\frac{\sin(L)}{\sinh(L)} \quad\to\quad \tanh(L)=-\tan(L) $$ General case (not particular value of $L$) : $$\tanh(L)\neq\tan(L) \quad\to\quad \text{ony the trivial solution } w=0$$
Particular cases of $L=L_p$ so that $\tanh(L_p)=-\tan(L_p)$ : $$w=c_3\left(\frac{c_1}{c_3}\cosh(x)+\cos(x)\right)=c_3\left(\frac{\cos(L_p)}{\cosh(L_p)}\cosh(x)+\cos(x)\right)$$ and with $C=\frac{c_3}{\cosh(L_p)}$ $$w(x)=C\left(\cos(L_p)\cosh(x)+\cosh(L_p)\cos(x)\right)$$