AHere are a few ways that do not depend on being able to solve the implicit equation for the solution, based on differentiating the implicit equation. The key here is that the differentiated solution is linear in the derivative. Thus it can be used to eliminate the derivative from the ODE. If there is an initial condition, which is not given in the OP's example, it may be plugged into the solution and checked.
Eliminate[{ode = x'[t] == (x[t] - 1) (1 - 2 x[t]), ;
implsol = D[Log[Log[(2*x[t] - 1)/(x[t] - 1)] == tt;
Eliminate[{ode, t]implsol}, {x'[t]}]
(* -1 + x[t] != 0 && -1 + 2 x[t] != 0 *)
Solve[{x'[t] == (x[t] - 1) (1 - 2 x[t]),
D[Log[(2*x[t] - 1)/(x[t] - 1)] == tode, t]implsol}, x[t], {x'[t]}]
Solve::fulldim: The solution set contains a full-dimensional component; use Reduce for complete solution information. >>
Solve::fulldim: The solution set contains a full-dimensional component; use Reduce for complete solution information. >>
ode /. Solve[D[implsol, t], {x'[t]}] // Simplify
(* {True} *)
4.
As an alternative to (3), one can check whether the residual will simplify to zero. When you get a warning about inverse functions, branch cuts, and so forth, one might wish to check numerically as I did in DSolve for Second Order Differential to eliminate one of the solutions returned by DSolve
.
residual[a_ == b_] := a - b;
residual@ode /. Solve[D[implsol, t], {x'[t]}] // Simplify
(x[t]* {0} *)
If it simplifies to a function, one might try FullSimplify
or substituting random values for the independent variable t
. It is possible that due to branch cuts, the solution is invalid only on some interval, which would probably prevent the expression from simplifying down to 0
.
More examples
This ODE is from the docs for DSolve
, and DSolve
returns an implicit solution in terms of Solve
.
ode = y'[x] == y[x]^3 - ((x + 1) y[x]^2)/x;
dsol = DSolve[ode, y[x], x]
implsol = First@dsol (1* should check that dsol is of the form Solve[..] *)
(*
Solve[E^(-x 2+ x[t]1/y[x])/x + C[1] + ExpIntegralEi[-x + 1/.y[x]] == 0, y[x]]
Solve[D[Log[E^(2*x[t]-x + 1/y[x])/x + C[1] + ExpIntegralEi[-x + 1/y[x]] == 0
*)
Methods 1-3:
Eliminate[{ode, D[implsol, x]}, y'[x]]
Solve[{ode, D[implsol, x]}, y[x], {y'[x]}]
ode /. Solve[D[implsol, x], {y'[x]}] // Simplify
(x[t]*
x != 0 && y[x] != 0 && -1 + x y[x] != 0 (* 1 *)]
{{}} (* 2 *)
{True} (* 3 *)
*)
Here is another example from
Solution of an ODE in implicit form:
ode = (y[x] + x - 1)*y'[x] - y[x] + 2 x + 3 == t0;
DSolve[ode, t]y[x], x];
implsol = First@%;
Eliminate[{x'[t]ode, D[implsol, x]}, y'[x]]
Solve[{ode, D[implsol, x]}, y[x], {y'[x]}]
ode /. Solve[D[implsol, x], {y'[x]}] // Simplify
(*
11 + 8 x + 6 x^2 - 10 y[x] + 3 y[x]^2 != 0
*)
Solve::fulldim: The solution set contains a full-dimensional component; use Reduce for complete solution information.
(*
{True{}}
{True}
*)