To follow up on my remark about DSolve[]
not solving for parameters, if one makes mu a dependent variable, then DSolve[]
will solve for it. This can be done by replacing μ
by μ[x]
and adding the differential equation μ'[x] == 0
. Unfortunately, the default solver uses inverse functions in this case. That yields only one solution, the trivial solution, instead of all solutions:
ode = yy''''[x] + \[Mu]^2 yy''[x] == 0;
bcs = {yy[0] == 0, yy[l] == 0, yy''[0] == 0, yy''[l] == 0};
DSolve[{ode /. \[Mu] -> \[Mu][x], \[Mu]'[x] == 0, bcs}, {yy[x], \[Mu][x]}, x,
Assumptions -> \[Mu][x] > 0 && l > 0]
(* `DSolve::ifun`: Inverse functions are being used by DSolve, so some solutions may not be found. *)
(* {{yy[x] -> 0, \[Mu][x] -> C[1]}} *)
However, we can use what is often called the Villegas-Gayley trick to adjust how Solve[]
works:
Internal`InheritedBlock[{Solve},
Unprotect[Solve];
Solve[eq_, v_, opts___] /; ! TrueQ[$in] := Block[{$in = True},
Simplify@Solve[Flatten@{eq, $Assumptions}, v, Method -> Reduce, opts]];
Protect[Solve];
DSolve[{ode /. \[Mu] -> \[Mu][x], \[Mu]'[x] == 0, bcs}, {yy[x], \[Mu][x]}, x,
Assumptions -> \[Mu][x] > 0 && l > 0 && C[1] > 0]
]
(*
{{yy[x] -> 0, \[Mu][x] -> C[1]},
{yy[x] -> ConditionalExpression[
-((l^3*C[3] Sin[(2*Pi*x*C[6])/l])/(8*Pi^3*C[6]^3)),
Element[C[6], Integers] && C[6] >= 1],
\[Mu][x] -> ConditionalExpression[
(2*Pi*C[6])/l,
Element[C[6], Integers] && C[6] >= 1]},
{yy[x] -> ConditionalExpression[
-((l^3*C[3] Sin[(x*(Pi + 2*Pi*C[6]))/l])/(Pi^3*(1 + 2*C[6])^3)),
Element[C[6], Integers] && C[6] >= 0],
\[Mu][x] -> ConditionalExpression[
(Pi + 2*Pi*C[6])/l,
Element[C[6], Integers] && C[6] >= 0]}}
*)
The extra condition C[1] > 0
is not necessary but simplifies the output. It was added as an afterthought, after seeing \[Mu][x]
was solved as \[Mu][x] -> C[1]
in terms of C[1]
. The assumption \[Mu][x] > 0
is not automatically extended to include C[1]
.
One could simplify the values in the solution to
C[3] Sin[2 π x C[6] / l]
and
C[3] Sin[x (π + 2 π C[6]) / l]
,
if one wanted to. A general code to do so takes some work.