1
$\begingroup$

My professor's worked example for solving a partial differential equation using variable splitting seems to choose the format of solutions for the ordinary differential equations at random. For example, splitting the 1D diffusion equation $\frac{\delta^2\rho}{\delta x^2} = \frac{1}{c}\frac{\delta \rho}{\delta t}$ into $\rho(x, t) = X(x)T(t)$ gave me the ODE $\frac{d^2 x}{dx^2} + kx^2 = 0$, which I solved as $X(x) = Ae^{ikx}+Be^{-ikx}$ (which is correct). My professor gave $X(x) = A\sin(kx) + B\cos(kx)$. I'm aware that these are equivalent, but why did she choose to answer using trig functions? We've been taught to solve ODEs using exponentials so it's not like the answer was just in that form, and the other ODE was answered using an exponential. I understand that it could make the rest of the problem easier to solve but is that even recognisable at that point in the working?

$\endgroup$
3
  • 3
    $\begingroup$ The expression for $X(x)$ is manifestly real, and in applications one often only wants real solutions. $\endgroup$ Commented May 16, 2023 at 19:44
  • 2
    $\begingroup$ In your solution, the coefficients $A,B$ are complex numbers; in your professor's, they are real. They both (should!) amount to the same solution, which can be verified with Euler's formula. $\endgroup$
    – user170231
    Commented May 16, 2023 at 19:50
  • 1
    $\begingroup$ And also, the representation in terms of sines and cosines lends itself to apply boundary conditions. $\endgroup$
    – Kenny Wong
    Commented May 16, 2023 at 19:50

1 Answer 1

1
$\begingroup$

A lot of this just comes from experience with a variety of results. There are ways to do this rigorously (via, e.g. variation of parameters and the Wronskian matrix), but one of the earliest results you encounter in ODEs is that the general solution to

$y'' + k^2 y = 0$

where $y$ is a real-valued function of $x$, is $y = A \cos kx + B \sin kx$.

You can do this just by identifying that the DE can also be written as $y'' = -k^2 y$, and noting that the sine and cosine functions both have the property that their second derivatives are the negative of the function itself.

As you noted, you can also write the general solution as $y = C e^{ikx} + D e^{-ikx}$, but you then have to do extra work to note that if $y$ is restricted to taking real values then there are restrictions on $C$ and $D$ (which are going to be complex numbers) to ensure that the imaginary parts of the expression cancel out.

$\endgroup$

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .