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?
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?
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})]]