4
$\begingroup$

Here are two equations:

    eq1 = D[z[x], {x, 4}] + z[x] == 0;
eq2 = D[z[x], {x, 4}] + q^4*z[x] == 0;

They only differ from one another by the scale factor q^4, where q>0. I need to solve them in real numbers. If I solve the first one I get

  DSolveValue[eq1, z[x], x]

(* E^(x/Sqrt[2]) C[1] Cos[x/Sqrt[2]] + E^(-(x/Sqrt[2])) C[2] Cos[x/Sqrt[2]] + E^(-(x/Sqrt[2])) C[3] Sin[x/Sqrt[2]] + E^(x/Sqrt[2]) C[4] Sin[x/Sqrt[2]]     *)

enter image description here

which is convenient to look at. However, if I solve the second one, I get:

 DSolveValue[eq2, z[x], x]

(*  E^((-1)^(3/4) q x) C[1] + E^(-(-1)^(1/4) q x) C[2] + E^(-(-1)^(3/4) q x) C[3] + E^((-1)^(1/4) q x) C[4]   *)

enter image description here

which is alredy less convenient. Since q is real and positive, it is obvious, that the solution is like the solution of eq1, in which we make a replacement: x->q*x:

    DSolveValue[eq1, z[x], x] /. x -> q*x

(* E^((q x)/Sqrt[2]) C[1] Cos[(q x)/Sqrt[2]] + E^(-((q x)/Sqrt[2])) C[2] Cos[(q x)/Sqrt[2]] + E^(-((q x)/Sqrt[2])) C[3] Sin[(q x)/Sqrt[2]] + E^((q x)/Sqrt[2]) C[4] Sin[(q x)/Sqrt[2]]  *)

enter image description here

However, I cannot find a regular operation which would transform the solution of eq2 into this form.

Any idea?

$\endgroup$
  • $\begingroup$ Dirty trick, not recommended: DSolveValue[D[z[x], {x, 4}] + EulerGamma^4*z[x] == 0, z, x] /. EulerGamma -> q. (Any positive symbolic constant could have worked just as well.) $\endgroup$ – J. M. will be back soon Oct 5 '16 at 11:43
  • $\begingroup$ @ J. M. I admire this trick, the more that one can use, say, Pi instead of the EulerGamma . However, I am preparing this for students, and poor students will go crazy with such tricks. They need something more regular. $\endgroup$ – Alexei Boulbitch Oct 5 '16 at 12:33
  • $\begingroup$ Yes, that's why I emphasized "not recommended"... I tried Assumptions, but it does nothing useful in this case. $\endgroup$ – J. M. will be back soon Oct 5 '16 at 12:34
  • $\begingroup$ Similar to questions 126132 and 126768. $\endgroup$ – bbgodfrey Oct 6 '16 at 11:33
  • $\begingroup$ @ bbgodfrey Thank you. As much as I understood from your answer, there is no satisfactory answer, as yet, right? $\endgroup$ – Alexei Boulbitch Oct 6 '16 at 15:48
4
$\begingroup$
eq2 = D[z[x], {x, 4}] + q^4*z[x] == 0;
sol = DSolveValue[eq2, z[x], x]

enter image description here

sol2 = ComplexExpand@sol

enter image description here

rule = First@
  Solve[{C[1] + C[2] == a, C[3] + C[4] == b, I (C[1] - C[2]) == c, 
    I (-C[3] + C[4]) == d}, {C[1], C[2], C[3], C[4]}]

enter image description here

sol2 /. rule // Expand

enter image description here

$\endgroup$
4
$\begingroup$

Similar to corey979's answer

eq1 = D[z[x], {x, 4}] + z[x] == 0;
eq2 = D[z[x], {x, 4}] + q^4*z[x] == 0;

sol1 = DSolveValue[eq1, z[x], x]

enter image description here

The terms without the GeneratedParameters are

terms1 = List @@ sol1 /. C[_] :> 1

enter image description here

Using distinct GeneratedParameters for sol2

sol2 = DSolveValue[eq2, z[x], x,
  GeneratedParameters -> d]

enter image description here

Finding the relations between the two sets of GeneratedParameters

rules =
 Solve[
    Thread[
     (Coefficient[sol1 , #] & /@ terms1) ==
      (Coefficient[
          sol2 /. q -> 1 //
           ComplexExpand[#, Array[d, 4]] &,
          #] & /@ terms1)], Array[d, 4]][[1]] //
  Simplify[#, Element[Array[C, 4], Reals]] &

enter image description here

Substituting the GeneratedParameters

sol2 = sol2 /. rules // ComplexExpand

enter image description here

Verifying

sol1 == (sol2 /. q -> 1)

(*  True  *)
$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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