3
$\begingroup$

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

enter image description here

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?

$\endgroup$
6
  • 1
    $\begingroup$ Same problem. I am running on Windows 10, x64, MMA 14.0. $\endgroup$ Commented Jun 24 at 1:21
  • 1
    $\begingroup$ @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! $\endgroup$
    – Moo
    Commented Jun 24 at 1:34
  • 2
    $\begingroup$ Same problem on "14.0.0 for Mac OS X ARM (64-bit) (December 13, 2023)". $\endgroup$
    – A. Kato
    Commented Jun 24 at 1:41
  • 2
    $\begingroup$ Note it fails on Wolfram Cloud V14 Linux, too. $\endgroup$
    – Goofy
    Commented Jun 24 at 1:44
  • 2
    $\begingroup$ @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. $\endgroup$
    – Moo
    Commented Jun 24 at 9:37

3 Answers 3

6
$\begingroup$

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}}
*)
$\endgroup$
2
  • 1
    $\begingroup$ Bizarre that that works! $\endgroup$
    – Moo
    Commented Jun 24 at 1:52
  • 2
    $\begingroup$ @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. $\endgroup$
    – Goofy
    Commented Jun 24 at 2:51
3
$\begingroup$
$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} *)
$\endgroup$
0
$\begingroup$

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

enter image description here

$\endgroup$
4
  • 3
    $\begingroup$ I am still seeing what I show above, this did not change anything. $\endgroup$
    – Moo
    Commented Jun 24 at 0:02
  • 2
    $\begingroup$ @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[]. $\endgroup$
    – Goofy
    Commented Jun 24 at 1:42
  • 1
    $\begingroup$ @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. $\endgroup$
    – Moo
    Commented Jun 24 at 1:51
  • 1
    $\begingroup$ @zeraouliarafik: Please add the OS and version of MMA you are using as this seems like a new bug. $\endgroup$
    – Moo
    Commented Jun 24 at 1:52

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.