I solved a nonlinear differential equation (d'Alembert one) by hand. Mathematica gives the same answer.
But I am not able to get Mathematica to verify the solution due to branch cuts.
Any one knows of a trick to verify the solution?
I tried different assumptions but can't find the right set. I know the solution is correct, well, at least I get same solution, but wanted to see if there is a trick to verify the solution back into the ODE, that is all.
ClearAll[y,x];
ode = y'[x] == Sqrt[1 + x + y[x]]
sol = DSolve[ode, y, x]
Tried
Simplify[ode /. sol]
Assuming[Element[x, Reals] && x > 0, FullSimplify[ode /. sol]]
and so on. Not able to get True
.
Appendix
hand solution
Solve \begin{align*} {\frac {\rm d}{{\rm d}x}}y \left( x \right) &=\sqrt {1+x+y \left( x \right) } \end{align*}
This is d'Alembert ODE. It has the form $y \left( x \right) =x g(y'(x)) + f(y'(x))$. where $g$ and $f$ are functions of $y'(x)$.
Solving for $y \left( x \right) $ from the above and keeping only real solutions for $y \left( x \right) $ and letting $p=y'(x)$ gives \begin{align*} y \left( x \right) &= {p}^{2}-x-1 \tag{1} \\ \end{align*} ODE (1) is now solved.
In this ODE $g(y'(x)) = -1$ and $f(y'(x))={p}^{2}-1$.
Taking derivatives of (1) w.r.t. $x$ and remembering that $p$ is a function of $x$ results in
\begin{align*}
p &= -1+ \left(2\,p\right) \frac{ \mathop{\mathrm{d}p}}{\mathop{\mathrm{d}x}}\\
p+1 &= \left(2\,p\right) \frac{ \mathop{\mathrm{d}p}}{\mathop{\mathrm{d}x}}\tag{2}\\
\end{align*}
The singular solution is found by setting $ \frac{ \mathop{\mathrm{d}p}}{\mathop{\mathrm{d}x}}=0$, which implies that $p$ is a constant. From the above, this results in
\begin{align*}
p+1&=0\\
\end{align*}
Solving the above for $p$ gives
\begin{align*}
p&=-1\\
\end{align*}
Substituting $-1$ values in (1) gives the singular solution $$ y \left( x \right) =-x $$ But this solution does not satisfy the ODE, hence will not be used
The general solution is found when $ \frac{ \mathop{\mathrm{d}p}}{\mathop{\mathrm{d}x}}\neq 0$. Rewriting (2) as
\begin{align*}
\frac{ \mathop{\mathrm{d}p}}{\mathop{\mathrm{d}x}} &={\frac {p+1}{2\,p}}\\
\end{align*}
Inverting the above gives
\begin{align*}
\frac{ \mathop{\mathrm{d}x}}{\mathop{\mathrm{d}p}} &=2\,{\frac {p}{p+1}}
\end{align*}
$x \left( p \right) $ is now the dependent variable and $p$ as the independent variable.
Now this ODE is solved for $x \left( p \right) $.
Since ${\frac {\rm d}{{\rm d}p}}x \left( p \right) = 2\,{\frac {p}{p+1}}$ then
$$
x \left( p \right) = \int{2\,{\frac {p}{p+1}} \mathop{\mathrm{d}p}} = 2\,p-2\,\ln \left( p+1 \right) + C
$$
Solving (using the computer) for $p$ from the above in terms of $x$ gives
\begin{align*}
p &= - \mathrm{LambertW} \left( -{{\rm e}^{-{\frac {x}{2}}-1+{\frac {C_{{1}}}{2}}}} \right) -1\\
\end{align*}
Substituting the above solution for $p$ in Eq (1) gives the general solution.
$$ y \left( x \right) = \left( \mathrm{LambertW} \left( -{{\rm e}^{-{\frac {x}{2}}-1+{\frac {C_{{1}}}{2}}}} \right) \right) ^{2}+2\, \mathrm {LambertW} \left( -{{\rm e}^{-x/2-1+1/2\,C_{{1}}}} \right) -x $$
ps. LambertW
is ProductLog
y[x] == v[x] - x
which turns the ODE into a separable equation. $\endgroup$