Solving and Plotting Differential Equation using DSolve

I have got a differntial equation which I have tried to solve with DSolve

sol = DSolve[p'[t] - (2 p[t]^2) - 3 p[t] + 4 p[t]^-9 == 0, p, t]

The answer implies RootSum. The question is how to use and plot the solution. I have tried

Plot[Evaluate[p[t] /. sol /. {C -> 1}], {t, -7, 7}]

which doesn't work. Moreover, this case is not documented in the documentation "Plotting the Solution".

Need help; Thanks

• Do you necessarily need an analytical solution ? It may be best to go for NDSolve. Nov 3 '16 at 11:24
• When using NDSolve[] it appears that for any initial condition, the system quickly reaches a singularity. Nov 3 '16 at 11:26
• @Feyre: Not when I tried to solve it in the range {0,7} Nov 3 '16 at 11:35
• I am getting some kind of solution and also a plot of it but I am unable to make anything out if it specifically the cone like shape in the plot, NDSolve[{p'[t] - (2 p[t]^2) - 3 p[t] + 4 p[t]^-9 == 0, p' == 2}, p, {t, 0, 10}] Nov 3 '16 at 11:40
• @Feyre and @Lotus, The plot code I have used is Plot[Evaluate[p[t] /. %], {t, 0, 10}] but I am unable to make anything out if it specifically the cone like shape in the plot. Nov 3 '16 at 11:51

The problem is not RootSum but Solve:

sol = DSolve[p'[t] - (2 p[t]^2) - 3 p[t] + 4 p[t]^-9 == 0, p, t]
(*
Solve[1/2 RootSum[-4 + 3 #1^10 + 2 #1^11 &,
Log[p[t] - #1]/(15 + 11 #1) &] == t + C, p[t]]
*)

Workarounds for plotting include replacing Solve with FindRoot or # &, or replacing the variable to be solved for by t:

Block[{Solve = fr, fr, t},
fr[eq_, x_] /; NumericQ[t] :=(*x/.*)FindRoot[eq, {x, 1}];
Plot[Evaluate@Quiet[p[t] /. (sol /. {C -> 1})], {t, -1.45, -1},
PlotRange -> {0, 50}]
] Block[{Solve = # &, p},
ContourPlot[sol /. {p[t] -> p, C -> 1} // Evaluate,
{t, -1.4, -1}, {p, 0, 50}, Exclusions -> None]
]

(* plot like that above *)

Solving for t gives us the inverse function of the solution, which we can plot with ParametricPlot:

Block[{eq, t},
eq = Block[{Solve = #1 &}, sol];
With[{tt = t /. First@Solve[eq /. {C -> 1, p[t] -> p}, t]},
ParametricPlot[{tt, p}, {p, 0, 50}, PlotRange -> All,
AspectRatio -> 0.6, Exclusions -> None]
]]

(* plot like that above *)

Update: Alternatives for visualizing the solutions of a first-order ODE

One can plot the direction field with StreamPlot. Here is a utility to construct a direction field.

Clear[dirfield];
dirfield[de_, v_, t_] := Module[{y, df},
y = First@Flatten[{v /. (y1_)[t] :> y1}];
df = {1, y'[t]} /. Solve[de, y'[t]];
First[df /. y[t] -> y] /; Length[df] == 1
];

Expand@dirfield[p'[t] - (2 p[t]^2) - 3 p[t] + 4 p[t]^-9 == 0, p, t]
(*  {1, -(4/p^9) + 3 p + 2 p^2}  *)

Since the OP's ODE is autonomous, it is natural to consider the equilibria.

equilibria = NSolve[-(4/p^9) + 3 p + 2 p^2 == 0, Reals]
(*  {{p -> -1.45198}, {p -> -1.21521}, {p -> 0.978767}}  *)

There is also a singularity at p == 0. We can incorporate these features into StreamPlot[].

StreamPlot[
dirfield[p'[t] - (2 p[t]^2) - 3 p[t] + 4 p[t]^-9 == 0, p, t],
{t, -1, 1}, {p, -2, 1.5},
StreamPoints -> {Join[{{0, p}, Red} /. equilibria, {Automatic}]} // Evaluate,
GridLines -> {None, {0}}, GridLinesStyle -> Green,
] The behavior near p == 0.978767 can be inferred, but a better picture can be obtained by zooming in. With StreamPlot[], I would advise keeping the intervals of t and p approximately equal in length. If you want a much larger range of t than p or vice versa, I would advise rescaling so that the ranges are about the same.

StreamPlot[
dirfield[p'[t] - (2 p[t]^2) - 3 p[t] + 4 p[t]^-9 == 0, p, t],
{t, -0.1, 0.1}, {p, 0.9, 1.1},
StreamPoints -> {{Last[{{0, p}, Red} /. equilibria], Automatic}}, 