# Odd results from DSolve

When I try this DSolve command

DSolve[{x'[t] == y[t] + 2 E^t, y'[t] == x[t] - 2 E^t}, {x, y}, t]

I get this as the return

I tried this on two different computers and got the same thing.

I am running on Windows 10, x86, MMA 14.0.

As an aside, I took the exact command and ran it on Wolfram Alpha and get the correct result, so I do not think there is something wrong with the input. I even copied the Wolfram command back into my MMA session.

I have never had this issue before.

Any ideas?

• Same problem. I am running on Windows 10, x64, MMA 14.0. Commented Jun 24 at 1:21
• @E.Chan-López: I never had this issue on previous versions of MMA - so I think it may be a new bug. Thank you for verifying that!
– Moo
Commented Jun 24 at 1:34
• Same problem on "14.0.0 for Mac OS X ARM (64-bit) (December 13, 2023)". Commented Jun 24 at 1:41
• Note it fails on Wolfram Cloud V14 Linux, too. Commented Jun 24 at 1:44
• @march: Thanks for checking. That makes sense as I would have noticed this in previous releases since I use that command quite a bit. I suspect this is new in V14.0.
– Moo
Commented Jun 24 at 9:37

It's a bug. Report it.

Odd workaround for the odd behavior (V14.0.0):

DSolve[{x'[t] == y[t] + 2  e^t, y'[t] == x[t] - 2  e^t}, {x, y},
t] /. e -> E
{x'[t] == y[t] + 2  E^t, y'[t] == x[t] - 2  E^t} /. % // Simplify
(*
{{x -> Function[{t},
1/2  E^-t  (1 + E^(2 t))  C[1] +
1/2  E^-t  (-1 + E^(2 t))  C[2] - (
E^(-t + t (1 + Log[E])) (-1 + E^(2 t)))/(1 + Log[E]) + (
E^(-t + t (1 + Log[E])) (1 + E^(2 t)))/(1 + Log[E])],
y -> Function[{t},
1/2  E^-t  (-1 + E^(2 t))  C[1] +
1/2  E^-t  (1 + E^(2 t))  C[2] + (
E^(-t + t (1 + Log[E])) (-1 + E^(2 t)))/(1 + Log[E]) - (
E^(-t + t (1 + Log[E])) (1 + E^(2 t)))/(1 + Log[E])]}}

{{True, True}}
*)
• Bizarre that that works!
– Moo
Commented Jun 24 at 1:52
• @Moo I looked at the equation and thought I could put any old f[t] in for E^t. But f[t] results in an inactive integral, which could be dealt with but is not very convenient. An arbitrary exponential like a^t can be integrated; plus it can represent E^t. So it's a much better choice. I picked e for the base instead of a for its cuteness factor. This gives a simpler solution: DSolve[{x'[t] == y[t] + 2 E^t, y'[t] == x[t] - 2 E^t} /. E -> e, {x[t], y[t]}, t] /. e -> E /. {C[1] -> C[1] + C[2], C[2] -> C[1] - C[2]} // Simplify //DSolveDSolveToPureFunction, but it's more work. Commented Jun 24 at 2:51
\$Version

(* "14.0.0 for Mac OS X ARM (64-bit) (December 13, 2023)" *)

Clear["Global*"]

Also fails with v14 on a Mac; however, since you know that Wolfram|Alpha works:

sol = WolframAlpha["DSolve[{x'[t] == y[t] + 2 E^t, y'[t] == x[t] - 2 E^t},
{x, y}, t]", "WolframResult"]

(* {{x -> Function[{t}, -(1/2) (E^t (-1 + E^(2 t))) +
1/2 E^t (1 + E^(2 t)) + ((1 + E^(2 t))  C[1])/(
2 E^t) + ((-1 + E^(2 t))  C[2])/(2 E^t)],
y -> Function[{t},
1/2 E^t (-1 + E^(2 t)) - 1/2 E^t (1 + E^(2 t)) + ((-1 + E^(2 t))  C[1])/(
2 E^t) + ((1 + E^(2 t))  C[2])/(2 E^t)]}} *)

Verifying,

{x'[t] == y[t] + 2 E^t, y'[t] == x[t] - 2  E^t} /. sol[[1]] // Simplify

(* {True, True} *)

Wouldn't the following code solve your problem? I think the output is compatible with what you have got using Wolfram Alpha.

(*Define the system of differential equations*)
system = {x'[t] == y[t] + 2 E^t, y'[t] == x[t] - 2 E^t};

(*Solve the system using DSolve*)
solution = DSolve[system, {x[t], y[t]}, t]

(*Simplify the solution*)
simplifiedSolution = Simplify[solution]

(*Output the simplified solution*)
simplifiedSolution

• I am still seeing what I show above, this did not change anything.
– Moo
Commented Jun 24 at 0:02
• @Moo Perhaps @ zeraoulia is using a different version. Perhaps they didn't pay attention to the version in which the bug occurs. OTOH, the above obviously changes nothing in the input to DSolve[]. Commented Jun 24 at 1:42
• @Goofy: I think you are correct as I use this function a lot and this is the first time I have seen this issue. In older versions, I never saw this issue.
– Moo
Commented Jun 24 at 1:51
• @zeraouliarafik: Please add the OS and version of MMA you are using as this seems like a new bug.
– Moo
Commented Jun 24 at 1:52