I have been trying to solve a physical problem during which I reach the following third-order, Linear O.D.E.

The solution I get using this expression is really messy. Is there any way to simplify it in the form of trig functions or some alternative ?

$$f'''_n(x) + \alpha f''_n(x)-\Bigg(\bigg(\frac{n\pi}{d}\bigg)^2 + \beta\Bigg) f_n'(x)-\alpha \bigg(\frac{n\pi}{d}\bigg)^2 f_n(x)=-\frac{2 \alpha \beta \gamma d}{(md)^2 + (n\pi)^2} \tag 2$$

with the following boundary conditions $$f'_n(0)=f'_n(L)=0\\ f''_n(0)- \Bigg(\bigg(\frac{n\pi}{d}\bigg)^2 + \beta\Bigg)f_n(0)=0$$

ALSO $$\beta = m^2$$ Any help on solving $(2)$ is really appreciated


DSolve[{y'''[x] == -\[Alpha]*y''[x] + ((n*\[Pi]/d)^2 + \[Beta])*
     y'[x] + \[Alpha]*((n*\[Pi]/d)^2)*
     y[x] - ((2*\[Alpha]*\[Beta]*\[Gamma]*d)/((m*d)^2 + (n*\[Pi])^2)),
   y'[0] == 0, y'[L] == 0, 
  y''[0] - ((n*\[Pi]/d)^2 + \[Beta])*y[0] == 0}, y[x], x]
  • 3
    $\begingroup$ The solution I get using this expression is really messy solution is messy because the ODE is messy. You could try sol=ToRadicals[[sol] to remove roots. But simplifying the few pages of such solution is not going to be easy. You can try FullSimplify[sol] and see what it does. What are you expecting the solution to look like? If you have values for beta and alpha, then it is different matter. $\endgroup$
    – Nasser
    Nov 22, 2019 at 7:41
  • 1
    $\begingroup$ Third order DE with constant coefficients and a constant non-homogenous term should not be too difficult. If you can put your DE into the form deq = y'''[x] - (a + b + c) y''[x] + (a b + a c + b c) y'[x] - a b c y[x] == d, then DSolve[{deq}, y[x], x] will give you a nice answer. It seems feasible to solve for $a, b, c$ in terms of $\alpha, \beta$, but it will be messy. Consider the case of repeated roots of the characteristic polynomial by setting c=b before using DSolve. Solve for $d$ to get your non-homogeneous term after putting in the BCs. $\endgroup$
    – LouisB
    Nov 23, 2019 at 6:52
  • $\begingroup$ @LouisB Thanks for the suggestion. But I am afraid, I made some mistakes while deriving these equations and posted them in a wrong form earlier. I have now corrected them and the code. Can you have a look again ? Meanwhile, I will try to incorporate the suggestions from your last comment. $\endgroup$
    – Avrana
    Nov 23, 2019 at 7:39
  • $\begingroup$ If you call the roots a,b,c or something then it's not that bad. FullSimplify[% /. Root[-β + α β + α #1^2 + #1^3 &, n_] :> {a, b, c}[[n]]] $\endgroup$ Nov 23, 2019 at 13:47
  • 1
    $\begingroup$ In the ODE $$y''' + \alpha y''+\beta y'+\gamma y + \delta = 0$$ changing variable to $Y = y -\frac{\delta}{\gamma}$ we get the new ODE $$Y'''+\alpha Y''+\beta Y'+\gamma Y = 0$$ and also $Y'(0) = 0$,$ Y'(L) = 0$, $Y''(0)+\zeta\left(Y(0)+\frac{\delta}{\gamma}\right) = 0$. The solution is not so lengthy. $\endgroup$
    – Cesareo
    Nov 24, 2019 at 20:54

1 Answer 1


Echoing Nasser, the solution is messy because the ODE is messy. There is not much you can do. You can massage the solution into a slightly more compact form as follows: let $q_i$ be the solutions to the algebraic equation $$ q^3+ \alpha q^2- \left(\beta +\frac{\pi ^2 n^2}{d^2}\right)q-\frac{\pi ^2 \alpha n^2}{d^2}=0 $$ i.e.,

q[i_] :> Root[(n^2 π^2 α)/d^2 + ((n^2 π^2)/d^2 + β) #1 - α #1^2 - #1^3 &, i]

Let also $q_{i,j}$ denote the "other root", that is, $q_{1,2}=q_3$ together with cyclic permutations, $q_{2,3}=q_1$ and $q_{1,3}=q_2$. Finally, let $s_{ij}$ denote the sign of the permutation, that is, $s_{ij}=\operatorname{sign}(q_i,q_j,q_{ij})$:

q[1, 2] -> q[3]
q[1, 3] -> q[2]
q[2, 3] -> q[1]
s[i_, j_] := Signature[{i, j, q[i, j][[1]]}]

With this, the solution can be expressed as follows: $$ y(x)\propto \sum_{i,j} q_i q_j s_{ij} \left(e^{L q_j} \left(\beta d^2-\pi ^2 n^2 e^{x q_{i,j}}\right)+e^{L q_i} \left(\beta d^2 \left(2 e^{x q_{i,j}}-1\right)+2 d^2 q_{i,j}^2+\pi ^2 n^2 \left(e^{x q_{i,j}}-2\right)\right)\right) $$ as given by

Sum[s[i, j] q[i] q[j] (E^(L q[j]) (-E^(x q[i, j]) n^2 π^2 + d^2 β) + E^(L q[i]) ((-2 + E^(x q[i, j])) n^2 π^2 + d^2 (-1 + 2 E^(x q[i, j])) β + 2 d^2 q[i, j]^2)), {i, 1, 3}, {j, 1, 3}]

The constant of proportionality can easily be fixed by demanding that the ODE is satisfied, say, at $x=0$. I don't think one can find an expression for $y(x)$ much more compact than this. The problem is messy, its solution is messy. The presence of $s_{ij}$ suggests to me that perhaps it can be expressed as a determinant, but in practice I believe the expression above is your best bet. This, or do numerics only.

  • $\begingroup$ Thanks for this insight. I could follow your answer till you defined the rules and the sign of permutation. Could you please elaborate a little more on how you reached the $y(x)$. I am afraid this might be trivial, but I have been unable to follow it through. $\endgroup$
    – Avrana
    Nov 25, 2019 at 4:02
  • $\begingroup$ Awarded, the bounty because your representation is surely the most concise form there is But Still unable to reproduce it. $\endgroup$
    – Avrana
    Nov 27, 2019 at 20:51

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.