Hi,
Keep in mind that Log[]
is the complex logarithm:
Simplify[ComplexExpand@Log[x], x < 0]
(* 1/2 (2 I π + Log[x^2]) *)
Log[-1]
(* I π *)
(* etc. *)
Because your initial condition is at x == -1
, the Log[x]
in the solution returned by DSolve
has a nonzero imaginary part, namely, I π
. You can somewhat recover the desired form of the answer as follows:
Simplify[(I (2 I + 9 π + 9 I Log[x]))/x^3, x < 0]
(* (-2 - 9 Log[-x])/x^3 *)
It is, in fact, a strength that Mathematica works in terms of complex analysis, but OTOH, most people haven't studied complex analysis. From the point of view of mathematics through the first two years of college calculus (= introductory real analysis), it can seem unnecessarily complex -- i.e., complicated. :) -- to both students and professors. Recently, as Wolfram has made inroads into the introductory math curriculum and, reciprocally, interest in Wolfram has grown, functions such as CubeRoot[]
(V9), Surd[]
(V9), and RealAbs[]
(V11.1) have been introduced, which are the standard real functions studied in high school.