# Extra constant in solution of ODE using DSolve [closed]

A paper that I have states that the solution of the ODE $$-\frac{\left(\frac{\pi k}{a}\right)^2 Y(y)}{G_y}+\frac{Y''(y)}{G_x}+\frac{8 \theta }{\pi k}=0$$ is $$Y=A\sinh\left(\frac{k\pi\mu}{a}y\right)+B\cosh\left(\frac{k\pi\mu}{a}y\right)+\frac{8 \theta }{(\pi k)^3}a^2$$ where $$\mu=\sqrt{\frac{G_x}{G_y}}$$ and $$a$$, $$G_y$$, $$G_x$$, $$\theta$$ and $$k$$ are constants. When I enter this code in Mathematica

ode = Y''[y]/Gx - 1/Gy ((k π)/a)^2 Y[y] + 8/π θ/k == 0;
FullSimplify[DSolve[ode, Y[y], y]]


I get

{{Y[y] ->
(8 a^2 Gy θ)/(k^3 π^3) +
E^((Sqrt[Gx] k π y)/(a Sqrt[Gy])) C[1] +
E^(-((Sqrt[Gx] k π y)/(a Sqrt[Gy]))) C[2]}}


or

$$Y=\frac{8 a^2 G_y \theta }{\pi ^3 k^3}+c_1 \exp\left(\frac{\pi \sqrt{G_x} k y}{a \sqrt{G_y}}\right)+c_2 \exp\left(-\frac{\pi \sqrt{G_x} k y}{a \sqrt{G_y}}\right)$$

Why is there an extra $$G_y$$ in the $$\frac{8 a^2 G_y \theta }{\pi ^3 k^3}$$ term?

## closed as off-topic by Henrik Schumacher, MarcoB, Johu, Alex Trounev, bbgodfreyMar 16 at 4:14

This question appears to be off-topic. The users who voted to close gave this specific reason:

• "This question arises due to a simple mistake such as a trivial syntax error, incorrect capitalization, spelling mistake, or other typographical error and is unlikely to help any future visitors, or else it is easily found in the documentation." – Henrik Schumacher, MarcoB, Alex Trounev, bbgodfrey
If this question can be reworded to fit the rules in the help center, please edit the question.

• Well, you may explain it yourself if you set $c_1$ and $c_2$ to $0$ and substitute it into the ODE. (That means that a authors of the paper made a mistake.) – Henrik Schumacher Mar 14 at 7:16
• I'm voting to close this question as off-topic because it seems to be about the paper and not about Mathematica. – Johu Mar 15 at 14:12

Mathematica answer is correct. One way to find the particular solution is to use variation of parameters (another is undetermined coefficients).

$$\frac{1}{Gx}Y^{\prime\prime}\left( y\right) -\frac{1}{G_{y}}\left( \frac{\pi k}{a}\right) ^{2}Y\left( y\right) =-\frac{8\theta}{\pi k}$$

Putting it in normal form (for use with variation of paramaters)

$$Y^{\prime\prime}\left( y\right) -\frac{Gx}{G_{y}}\left( \frac{\pi k} {a}\right) ^{2}Y\left( y\right) =-\frac{8\theta}{\pi k}Gx$$

Using Variation of parameters to find particular solution, let $$Y_{p}\left( y\right) =Y_{1}\left( y\right) u_{1}\left( y\right) +Y_{2}\left( y\right) u_{2}\left( y\right)$$

Where $$Y_{1}\left( y\right) =\sinh\left( \frac{k\pi\mu}{a}y\right) ,Y_{2}\left( y\right) =\cosh\left( \frac{k\pi\mu}{a}y\right)$$ then, using $$F=-\frac{8\theta}{\pi k}Gx$$

\begin{align} u_{1}\left( y\right) & =-\int\frac{Y_{2}F}{W}dy\tag{1}\\ u_{2}\left( y\right) & =\int\frac{Y_{1}F}{W}dy\tag{2} \end{align}

Where $$W$$ is the Wronskian

\begin{align*} W & = \begin{vmatrix} Y_{1} & Y_{2}\\ Y_{1}^{\prime} & Y_{2}^{\prime} \end{vmatrix} = \begin{vmatrix} \sinh\left( \frac{k\pi\mu}{a}y\right) & \cosh\left( \frac{k\pi\mu} {a}y\right) \\ \frac{k\pi\mu}{a}\cosh\left( \frac{k\pi\mu}{a}y\right) & \frac{k\pi\mu} {a}\sinh\left( \frac{k\pi\mu}{a}y\right) \end{vmatrix} \\ & =\frac{k\pi\mu}{a}\sinh^{2}\left( \frac{k\pi\mu}{a}y\right) -\frac{k\pi \mu}{a}\cosh^{2}\left( \frac{k\pi\mu}{a}y\right) \\ & =\frac{k\pi\mu}{a}\left( \sinh^{2}\left( \frac{k\pi\mu}{a}y\right) -\cosh^{2}\left( \frac{k\pi\mu}{a}y\right) \right) \\ & =-\frac{k\pi\mu}{a} \end{align*}

Hence (1) becomes

\begin{align*} u_{1}\left( y\right) & =-\int\frac{\cosh\left( \frac{k\pi\mu}{a}y\right) \frac{8\theta}{\pi k}Gx}{\frac{k\pi\mu}{a}}dy\\ & =-\frac{8a\theta G_{x}}{k^{2}\pi^{2}\mu}\int\cosh\left( \frac{k\pi\mu} {a}y\right) dy\\ & =-\frac{8a\theta G_{x}}{k^{2}\pi^{2}\mu}\frac{\sinh\left( \frac{k\pi\mu} {a}y\right) }{\frac{k\pi\mu}{a}}\\ & =-\frac{8a^{2}\theta G_{x}}{k^{3}\pi^{3}\mu^{2}}\sinh\left( \frac{k\pi\mu }{a}y\right) \end{align*}

And (2) becomes

\begin{align*} u_{2}\left( y\right) & =\int\frac{\sinh\left( \frac{k\pi\mu}{a}y\right) \frac{8\theta}{\pi k}G_{x}}{\frac{k\pi\mu}{a}}dy\\ & =\frac{8\theta aG_{x}}{k^{2}\pi^{2}\mu}\int\sinh\left( \frac{k\pi\mu} {a}y\right) dy\\ & =\frac{8\theta aG_{x}}{k^{2}\pi^{2}\mu}\frac{\cosh\left( \frac{k\pi\mu} {a}y\right) }{\frac{k\pi\mu}{a}}\\ & =\frac{8\theta a^{2}G_{x}}{k^{3}\pi^{3}\mu^{2}}\cosh\left( \frac{k\pi\mu }{a}y\right) \end{align*}

Therefore the particular solution is

\begin{align*} Y_{p}\left( y\right) & =\sinh\left( \frac{k\pi\mu}{a}y\right) \left( -\frac{8a^{2}\theta G_{x}}{k^{3}\pi^{3}\mu^{2}}\sinh\left( \frac{k\pi\mu} {a}y\right) \right) +\cosh\left( \frac{k\pi\mu}{a}y\right) \left( \frac{8\theta a^{2}G_{x}}{k^{3}\pi^{3}\mu^{2}}\cosh\left( \frac{k\pi\mu} {a}y\right) \right) \\ & =\frac{8a^{2}\theta G_{x}}{k^{3}\pi^{3}\mu^{2}}\left( -\sinh^{2}\left( \frac{k\pi\mu}{a}y\right) +\cosh^{2}\left( \frac{k\pi\mu}{a}y\right) \right) \\ & =\frac{8a^{2}\theta G_{x}}{k^{3}\pi^{3}\mu^{2}} \end{align*}

But $$\mu=\sqrt{\frac{G_{x}}{G_{y}}}$$ hence the above becomes

$$Y_{p}\left( y\right) =\frac{8a^{2}\theta}{\left( k\pi\right) ^{3}}G_{y}$$

• Thanks again! I made a follow up question here because it wouldn't fit in the comment box. Basically this answer leads me to get numbers that are different from the solution that I'm following. – enea19 Mar 15 at 2:38

Another method to get a particular solution is to note that $$Y = K$$, $$K$$ a constant, is a solution to $$A\,Y''(y) + B\,Y(y) + C=0\,,$$ if $$A,B,C$$ are constants. Plugging $$Y=K$$ into the differential equation yields $$Y_p(y) = -C/B\,.$$ For $$-\frac{\left(\frac{\pi k}{a}\right)^2 Y(y)}{G_y}+\frac{Y''(y)}{G_x}+\frac{8 \theta }{\pi k}=0\,,$$ we have $$Y_p(y) = - \left. \frac{8 \theta }{\pi k} \right/\left( -\frac{\left(\frac{\pi k}{a}\right)^2}{G_y} \right) = \frac{8 a^2 G_y \theta }{\pi ^3 k^3} \,.$$

Or in Mathematica,

Solve[ode /. Y -> (K &), K]
(*  {{K -> (8 a^2 Gy θ)/(k^3 π^3)}}  *)


(Note K is an internal symbol, which normally should be avoided.)