# How can I understand the result Mathematica returned from DSolve?

I have solved an ODE using DSolve[], but I have a problem with understanding the solution. In general the solution is in the form:

InverseFunction[[many expressions using # and #1]&][g x+C[1]]

g is constant

What does #1 and & mean and what does mean InverseFunction in this context?

PS: The solution is:

$\text{InverseFunction}\left[\frac{40 g \text{$\#$1} s^{2/5}+\frac{3 Q^{3/5} \left(\left(1+\sqrt{5}\right) \sqrt[5]{B} g n^{9/5}-\left(-1+\sqrt{5}\right) \sqrt[5]{Q} s^{9/10}\right) \log \left(\frac{1}{2} \left(-1+\sqrt{5}\right) \sqrt[5]{B} \sqrt[5]{n} \sqrt[5]{Q} \sqrt[10]{s} \sqrt[3]{\text{$\#$1}}+B^{2/5} \sqrt[5]{s} \text{$\#$1}^{2/3}+n^{2/5} Q^{2/5}\right) \sqrt[10]{s}}{B^{4/5} n^{6/5}}+\frac{3 Q^{3/5} \left(\left(-1+\sqrt{5}\right) g n^{9/5} \sqrt[5]{B}+\left(1+\sqrt{5}\right) \sqrt[5]{Q} s^{9/10}\right) \log \left(\frac{1}{2} \left(1+\sqrt{5}\right) \sqrt[5]{B} \sqrt[5]{n} \sqrt[5]{Q} \sqrt[10]{s} \sqrt[3]{\text{$\#$1}}+B^{2/5} \sqrt[5]{s} \text{$\#$1}^{2/3}+n^{2/5} Q^{2/5}\right) \sqrt[10]{s}}{B^{4/5} n^{6/5}}+\frac{3 Q^{3/5} \left(\left(1+\sqrt{5}\right) \sqrt[5]{Q} s^{9/10}-\left(-1+\sqrt{5}\right) \sqrt[5]{B} g n^{9/5}\right) \log \left(-\frac{1}{2} \left(1+\sqrt{5}\right) \sqrt[5]{B} \sqrt[5]{n} \sqrt[5]{Q} \sqrt[10]{s} \sqrt[3]{\text{$\#$1}}+B^{2/5} \sqrt[5]{s} \text{$\#$1}^{2/3}+n^{2/5} Q^{2/5}\right) \sqrt[10]{s}}{B^{4/5} n^{6/5}}-\frac{3 Q^{3/5} \left(\left(1+\sqrt{5}\right) g n^{9/5} \sqrt[5]{B}+\left(-1+\sqrt{5}\right) \sqrt[5]{Q} s^{9/10}\right) \log \left(-\frac{1}{2} \left(-1+\sqrt{5}\right) \sqrt[5]{B} \sqrt[5]{n} \sqrt[5]{Q} \sqrt[10]{s} \sqrt[3]{\text{$\#$1}}+B^{2/5} \sqrt[5]{s} \text{$\#$1}^{2/3}+n^{2/5} Q^{2/5}\right) \sqrt[10]{s}}{B^{4/5} n^{6/5}}+\frac{6 \left(\sqrt{10-2 \sqrt{5}} \sqrt[5]{B} g n^{9/5} Q^{3/5} \sqrt[10]{s}-\sqrt{2 \left(5+\sqrt{5}\right)} Q^{4/5} s\right) \tan ^{-1}\left(\frac{4 \sqrt[5]{B} \sqrt[10]{s} \sqrt[3]{\text{$\#$1}}-\left(-1+\sqrt{5}\right) \sqrt[5]{n} \sqrt[5]{Q}}{\sqrt{2 \left(5+\sqrt{5}\right)} \sqrt[5]{n} \sqrt[5]{Q}}\right)}{B^{4/5} n^{6/5}}+\frac{6 \left(\sqrt{10-2 \sqrt{5}} g n^{9/5} Q^{3/5} \sqrt[10]{s} \sqrt[5]{B}+\sqrt{2 \left(5+\sqrt{5}\right)} Q^{4/5} s\right) \tan ^{-1}\left(\frac{4 \sqrt[5]{B} \sqrt[10]{s} \sqrt[3]{\text{$\#$1}}+\left(-1+\sqrt{5}\right) \sqrt[5]{n} \sqrt[5]{Q}}{\sqrt{2 \left(5+\sqrt{5}\right)} \sqrt[5]{n} \sqrt[5]{Q}}\right)}{B^{4/5} n^{6/5}}+\frac{12 \left(\sqrt[5]{B} g n^{9/5} Q^{3/5} \sqrt[10]{s}-Q^{4/5} s\right) \log \left(\sqrt[5]{n} \sqrt[5]{Q}-\sqrt[5]{B} \sqrt[10]{s} \sqrt[3]{\text{$\#$1}}\right)}{B^{4/5} n^{6/5}}-\frac{6 \left(\sqrt{2 \left(5+\sqrt{5}\right)} \sqrt[5]{B} g n^{9/5} Q^{3/5} \sqrt[10]{s}-\sqrt{10-2 \sqrt{5}} Q^{4/5} s\right) \tan ^{-1}\left(\frac{4 \sqrt[5]{B} \sqrt[10]{s} \sqrt[3]{\text{$\#$1}}-\left(1+\sqrt{5}\right) \sqrt[5]{n} \sqrt[5]{Q}}{\sqrt{10-2 \sqrt{5}} \sqrt[5]{n} \sqrt[5]{Q}}\right)}{B^{4/5} n^{6/5}}-\frac{6 \left(\sqrt{2 \left(5+\sqrt{5}\right)} g n^{9/5} Q^{3/5} \sqrt[10]{s} \sqrt[5]{B}+\sqrt{10-2 \sqrt{5}} Q^{4/5} s\right) \tan ^{-1}\left(\frac{4 \sqrt[5]{B} \sqrt[10]{s} \sqrt[3]{\text{$\#$1}}+\left(1+\sqrt{5}\right) \sqrt[5]{n} \sqrt[5]{Q}}{\sqrt{10-2 \sqrt{5}} \sqrt[5]{n} \sqrt[5]{Q}}\right)}{B^{4/5} n^{6/5}}-\frac{12 \left(g n^{9/5} Q^{3/5} \sqrt[10]{s} \sqrt[5]{B}+Q^{4/5} s\right) \log \left(\sqrt[5]{B} \sqrt[10]{s} \sqrt[3]{\text{$\#$1}}+\sqrt[5]{n} \sqrt[5]{Q}\right)}{B^{4/5} n^{6/5}}}{40 s^{7/5}}\&\right]\left[g x+c_1\right]$

-
# is explained here reference.wolfram.com/mathematica/ref/Slot.html first example answers your question about #1 and #2. For pure function please see reference.wolfram.com/mathematica/tutorial/PureFunctions.html which explains it well. For InverFunction please see reference.wolfram.com/mathematica/ref/InverseFunction.html – Nasser Dec 9 '12 at 5:24

Some DEs are more simple to solve for the dependent variable rather than the independent variable, for example $$\frac{dy}{dx} = y \quad\implies\quad \log(y)=x+c$$ from which you can obtain the solution for $y$ in terms of $x$ by using an inverse function, in this case $y=\exp(x+c)$. Not all examples are this easy to invert, so Mathematica sometimes has to leave the solution written in terms of InverseFunction.

The # and & are part of Mathematica's pure (or anonymous) function notation. In particular & occurs at the end of a pure function and #=#1 represents the first slot of the function. For example

(#^2 + 1&)


is equivalent to

Function[{x}, x^2 + 1]


and acts upon its arguments like any other function

(#^2 + 1&)[t] == Function[{x}, x^2 + 1][t] == t^2 + 1


So, your DE must have yielded a complicated algebraic expression $f(y)=x+c$ that needs to be solved for the variable that you are interested in, $y=f^{(-1)}(x+c)$, which Mathematica can only perform symbolically using InverseFunction.

-