2
$\begingroup$

y=C/(x+1) ( I get it from sol=DSolve[y'[x]==-y[x]/(x+1),y[x],x])

How I can plot this "sol" with showing tangents in list of points?

$\endgroup$
4
$\begingroup$
ClearAll[t, f]
f[c_][x_] := Evaluate[First[y[x] /. sol /. C[1] -> c]];
t[c_][x_, a_] := f[c][a] + (x - a) (D[f[c][s], s] /. s -> a)
mesh = -1/2;

Show[Plot[Evaluate[Table[f[c][z], {c, {-2, -1, 1, 2}}]], {z, -3, 3}, 
  PlotLegends -> (HoldForm[f][#][x] & /@ {-2, -1, 1, 2}), ImageSize -> Large],
 Plot[Evaluate[Table[ConditionalExpression[t[c][z, mesh], -1/3 + mesh <= z <= 1/3 + mesh],
   {c, {-2, -1, 1, 2}}]], {z, -3, 3}, 
  Mesh -> {{mesh}}, MeshStyle -> Directive[Red, PointSize[Large]], PlotStyle -> Dashed,
  PlotLegends -> (HoldForm[f[#]'][a] & /@ {-2, -1, 1, 2})]]

enter image description here

$\endgroup$
  • $\begingroup$ Ye but i want that PLOT+ to plot of some tangets of that curves in some points ? $\endgroup$ – Милош Вучковић Nov 18 '18 at 19:24
  • $\begingroup$ @МилошВучковић, please see the updated version. $\endgroup$ – kglr Nov 19 '18 at 0:08
  • $\begingroup$ Oh ye , that i wanted, tnx :) $\endgroup$ – Милош Вучковић Nov 19 '18 at 0:35

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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