<s>[INST] Singular Perturbation Theory problem for slightly unstable pde I'm learning about singular perturbation theory for solving an approximate solution to a pde and I'm a little confused on how to apply it. The problem I'm trying to work on is $\frac{\partial u}{\partial t} = k \frac{\partial^2 u}{\partial x^2} - \varepsilon u^3$ where $u(0,t)=u(L,t)=0$. I know I need to look for the different orders of $\varepsilon$ and solve for the non-perturbed equation: $\frac{\partial u}{\partial t} = k \frac{\partial^2 u}{\partial x^2} \rightarrow u_0(x,t)= A(t)\sin\frac{\pi x}{L}.$ I'm not sure what to do after this or the intuition of this method.
Then
$\frac{\partial u_1}{\partial t} = k \frac{\partial^2 u_1}{\partial x^2} -u_0^3 \\
\frac{\partial u_1}{\partial t} = k \frac{\partial^2 u_1}{\partial x^2} -(A(t)\sin\frac{\pi x}{L})^3 \\
\frac{\partial u_1}{\partial t} = k \frac{\partial^2 u_1}{\partial x^2} -(A(t))^3(\frac{3}{4}\sin\frac{\pi x}{L} - \frac{1}{4}\sin\frac{3 \pi x}{L})$
So I know the solution must go with $\sin\frac{\pi x}{L} - \sin\frac{3 \pi x}{L}$, so $u_1 = B_1 \sin\frac{\pi x}{L} + B_3 \sin \frac{3 \pi x}{L}$ meaning the total solution is $u = A(t)\sin\frac{\pi x}{L} - \varepsilon (B_1 \sin\frac{\pi x}{L} + B_3 \sin \frac{3 \pi x}{L})$ This can be further solved for B by applying $u_1$ to the above solution:
$\frac{dB_1}{dt}\sin\frac{\pi x}{L} + \frac{dB_3}{dt}\sin \frac{3\pi x}{L} = k[\frac{-\pi^2}{L^2}B_1\sin \frac{\pi x}{L} - \frac{9 \pi^2}{L^2} B_2 \sin \frac{3\pi x}{L}] - A^3[\frac{3}{4} \sin \frac{\pi x}{L} - \frac{1}{4} \sin \frac{3\pi x}{L}] \\
\sin \frac{\pi x}{L} [ \frac{dB_1}{dt} + \frac{k \pi^2}{L^2}B_1 + \frac{3}{4}A^3] + \sin \frac{3\pi x}{L}[ \frac{dB_3}{dt} + \frac{9k \pi^2}{L^2}B_3 - \frac{1}{4}A^3]=0$ Now I'm not sure how to solve for $B_1$ and $B_3$ from this.
 [/INST] A(t) can be solved from the first equation: $\frac{du}{dt} = k \frac{d^2u}{dx^2} \\ A'(t)\sin\frac{\pi x}{L} = -k \frac{\pi^2}{L^2} A(t) \sin\frac{\pi x}{L} \\A'(t)= -k \frac{\pi^2}{L^2} A(t) \\ A(t) = c_1 \exp(-k\frac{\pi^2}{L^2} t)$
and $c$ cannot be solved without an initial condition. This can be substituted into the two equation for solving for the B coefficients now:
$\frac{dB_1}{dt} + k\frac{\pi^2}{L^2} B_1 +\frac{3}{4} A^3 = 0 \\
\frac{dB_3}{dt} + 9k\frac{\pi^2}{L^2} B_3 -\frac{1}{4} A^3 = 0 \\
\frac{dB_1}{dt} + k\frac{\pi^2}{L^2} B_1 +\frac{3}{4} c_1 \exp(-3k\frac{\pi^2}{L^2} t) = 0 \\
\frac{dB_3}{dt} + 9k\frac{\pi^2}{L^2} B_3 -\frac{1}{4} c_1 \exp(-3k\frac{\pi^2}{L^2} t) = 0 \\
B_1 = \frac{3 c_1 \exp(-3k\frac{\pi^2}{L^2} t)}{8 k\frac{\pi^2}{L^2}} + c_2 \exp(-k\frac{\pi^2}{L^2} t) \\
B_3 = \frac{c_1 \exp(-3k\frac{\pi^2}{L^2} t)}{24 k\frac{\pi^2}{L^2}} + c_2 \exp(-9k\frac{\pi^2}{L^2} t)$ 
Bringing the final solution to be $u(x,t) = A(t) \sin \frac{\pi x}{L} - \varepsilon (B_1 \sin\frac{\pi x}{L} + B_3 \sin\frac{3\pi x}{L})$
</s>