Hello,
DSolve[{y'[x] == E^(2*x - y[x]), y[0] == 0}, y[x], x]
produces
{{y[x] -> Log[1/2 + E^(2 x)/2]}
which I think is the all solutions. But Mathematica shows
It seems there are other solution for this equation. What will be them?
Thanks.
By default Mathematica can’t give solution in implicit form .You need to use tricks to extract that information:
Block[{Solve, conds}, Unprotect[Solve];
Solve[e_, v_] :=
With[{res = Reduce[e, v]},(*capture the conditiions via a side-
effect*)conds =
res /. Equal[var_?(MemberQ[Flatten[{v}], #] &), __] :> Sequence[];
{Cases[res,
var_?(MemberQ[Flatten[{v}], #] &) == rhs_ :> Rule[var, rhs],
Infinity]}];
S = Transpose[{DSolve[{y'[x] == E^(2*x - y[x])}, y[x], x][[1]],
List @@ LogicalExpand[conds]}]][[1]]
S[[1]] /. ((Solve[0 == (S[[1, 1, 1]][[2]] /. x -> 0), C[1]] //
Simplify)[[1, 1]]) // Simplify
(*{{y[x] -> ConditionalExpression[(2*I)*Pi*C[2] + Log[-1/2 + E^(2*x)/2 + E^((-2*I)*Pi*C[2])],
Inequality[-Pi, Less, -2*Pi*Re[C[2]], LessEqual, Pi]]}, {Element[C[2], Integers],
ConditionalExpression[E^(2*x) + 2/E^((2*I)*Pi*C[2]) != 1, Inequality[-Pi, Less, -2*Pi*Re[C[2]], LessEqual, Pi]]}}*)
Regards M.I
I presume that Mathematica will extract the following implicit form for the solution:
1 + Tanh[x] == E^(2 x - y[x])
The next step is to take the logarithm of both sides. In general, the logarithm in the complex sense is multi-valued. Mathematica takes only one value among those, and this passage triggers the warning that some solutions MAY be lost.
Consider this example, which differs from yours only by the initial datum:
DSolve[{y'[x] == E^(2*x - y[x]), y[0] == 2 Pi I}, y[x], x]
Mathematica returns the empty set. In this case it has indeed lost some (one, actually) solution. To find it, Mathematica should have chosen a different branch of the logarithm.