Solving a differential equation in Mathematica
I have a syntax problem solving a differential equation in Mathematica (10th version).
The input for the equation that I need to solve is as follows:
solv = DSolve[{ a*u''[y] - b*u[y] == d, u'[0] == 0, u[1] == 0}, u, {y, -1, 1}]
That after using ExpToTrig and FullSimplify I get the response I am looking for:
(d (-1 + Cosh[(Sqrt[b] y)/Sqrt[a]] Sech[Sqrt[b]/Sqrt[a]]))/b
However, my problem arises when I want to fit more coefficients in the equation. For example:
solv = DSolve[{ a* u''[y] - b* c* u[y] == d, u'[0] == 0, u[1] == 0}, u, {y, -1, 1}]
This time I get for:
FullSimplify[ExpToTrig[Evaluate[u[y] /. solv]]]
Next answer:
(d (1 + E^((2 Sqrt[b] Sqrt[c])/Sqrt[a]) - E^(-((Sqrt[b] Sqrt[c] (-1 + y))/Sqrt[a])) - E^((Sqrt[b] Sqrt[c] (1 + y))/Sqrt[a])) (-1 + Tanh[(Sqrt[b] Sqrt[c])/Sqrt[a]]))/(2 b c)
Instead, when I merge b and c (substitute: bc = b * c):
solv = DSolve[{ a*u''[y] - bc*u[y] == d, u'[0] == 0, u[1] == 0}, u, {y, -1, 1}]
I get:
(d (-1 + Cosh[(Sqrt[bc] y)/Sqrt[a]] Sech[Sqrt[bc]/Sqrt[a]]))/bc
In my case, I cannot just replace because there are too many equations and some parameters (coefficients) are canceled.
Thank!
+3
source to share