Skip to main content
replaced http://mathematica.stackexchange.com/ with https://mathematica.stackexchange.com/
Source Link

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 DifferentialDSolve for Second Order Differential to eliminate one of the solutions returned by DSolve. That involves plugging into the residual random numbers for any parameters, the independent variable, and the dependent variable(s) and their derivatives. For a solution to the ODE, one should expect errors on the order of round-off error. In the present case, the residual simplifies symbolically to zero, which needs no numerical checking:

Here is another example from Solution of an ODE in implicit formSolution of an ODE in implicit form:

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. That involves plugging into the residual random numbers for any parameters, the independent variable, and the dependent variable(s) and their derivatives. For a solution to the ODE, one should expect errors on the order of round-off error. In the present case, the residual simplifies symbolically to zero, which needs no numerical checking:

Here is another example from Solution of an ODE in implicit form:

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. That involves plugging into the residual random numbers for any parameters, the independent variable, and the dependent variable(s) and their derivatives. For a solution to the ODE, one should expect errors on the order of round-off error. In the present case, the residual simplifies symbolically to zero, which needs no numerical checking:

Here is another example from Solution of an ODE in implicit form:

Clarification
Source Link
Michael E2
  • 244.8k
  • 18
  • 351
  • 774

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. That involves plugging into the residual random numbers for any parameters, the independent variable, and the dependent variable(s) and their derivatives. For a solution to the ODE, one should expect errors on the order of round-off error. In the present case, the residual simplifies symbolically to zero, which needs no numerical checking:

If it simplifies to a function, one might try FullSimplify or substituting random values for the independent variable t. It is possible in some cases that due to branch cuts, the solution is invalid only on some interval, which would probably prevent the expression from simplifying down to 0.

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.

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.

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. That involves plugging into the residual random numbers for any parameters, the independent variable, and the dependent variable(s) and their derivatives. For a solution to the ODE, one should expect errors on the order of round-off error. In the present case, the residual simplifies symbolically to zero, which needs no numerical checking:

If it simplifies to a function, one might try FullSimplify or substituting random values for the independent variable t. It is possible in some cases that due to branch cuts, the solution is invalid only on some interval, which would probably prevent the expression from simplifying down to 0.

Added examples
Source Link
Michael E2
  • 244.8k
  • 18
  • 351
  • 774

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}
*)

A few ways, 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[{x'[t] == (x[t] - 1) (1 - 2 x[t]), 
  D[Log[(2*x[t] - 1)/(x[t] - 1)] == t, t]}, {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)] == t, t]}, x[t], {x'[t]}]

Solve::fulldim: The solution set contains a full-dimensional component; use Reduce for complete solution information. >>

x'[t] == (x[t] - 1) (1 - 2 x[t]) /. 
  Solve[D[Log[(2*x[t] - 1)/(x[t] - 1)] == t, t], {x'[t]}] // Simplify
(*  {True}  *)

Here 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.

ode = x'[t] == (x[t] - 1) (1 - 2 x[t]);
implsol = Log[(2*x[t] - 1)/(x[t] - 1)] == t;
Eliminate[{ode, implsol}, {x'[t]}]
(*  -1 + x[t] != 0 && -1 + 2 x[t] != 0  *)
Solve[{ode, implsol}, x[t], {x'[t]}]

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
(*  {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          (* should check that dsol is of the form Solve[..] *)
(*
  Solve[E^(-x + 1/y[x])/x + C[1] + ExpIntegralEi[-x + 1/y[x]] == 0, y[x]]
  E^(-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 != 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 == 0;
DSolve[ode, y[x], x];
implsol = First@%;

Eliminate[{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}
*)
Source Link
Michael E2
  • 244.8k
  • 18
  • 351
  • 774
Loading