Mathematica Stack Exchange is a question and answer site for users of Mathematica. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I've been baffled by a lot of the behaviours of Mathematica 9 — so much that I regret upgrading my copy of Mathematica 8 (I would downgrade but I'm currently on vacation). Here is an example:

DSolve[{x^2*y''[x] + x*y'[x] - y[x] == 0}, y[x], x]

should return the simple answer of C1*x + C2/x. In fact, this is what Wolfram Alpha returns and also Mupad (a Maple within Matlab). However, Mathematica returns

Mathematica picture

Yes, I know you can simplify this for real output, but it baffles me why it doesn't do it in the first place. Moreover, once your differential equations become messy, this can be hard to do. I have encountered other examples where the output from Mathematica's DSolve seems to very strange indeed. This isn't an isolated example, and I encounter examples of these very simple DEs that Mathematica fails to simplify in any sort of obvious way.

I don't remember these difficulties in Mathematica 8 or previous versions. Does anybody know what is an easy fix or what's going on? I have also documented similar bugs in the series expansions here and here.

share|improve this question
These are not bugs. The output is correct. As Vitaliy points out, you simply need to constrain your problem appropriately. Early versions of Mathematica played fast and loose with real functions and real expressions -- leading to actual bugs/errors. Instead, this has been fixed by respecting the complex nature of many things (e.g. series/convergence). This makes certain tricks impossible if you fail to indicate to Mathematica that you are assuming all the variables in play are real. – Kellen Myers Aug 26 '14 at 17:25
up vote 8 down vote accepted

Constrain your assumptions:

Assuming[x \[Element] Reals, DSolve[{x^2*y''[x] + x*y'[x] - y[x] == 0}, y[x], x]]

{{y[x] -> 1/2 x C[1] + C[2]/x}}

share|improve this answer
nguns ;-) – Vitaliy Kaurov Jul 29 '13 at 7:11

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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