Can anybody help me to draw these figures in Latex? Sorry I'm new in Latex, so I really don't know how to do it. And is it possible to do it, where you can actually see the slope field (I know you really can't in the picture)? And how would I do, if I only wan't the x-axis and y-axis to be shown, and not the whole rectangle, as they have done in the picture? Hope somebody can help a new person in Latex! slope field

  • 1
    Welcome! This has been achieved in this answer. – user194703 Mar 16 '20 at 16:55
  • I see. Thanks. But what if I also want the explaining text in the slope field. Like y(0)=-3 etc, with a line to the particular solution that satisfy that condition? And the dot? Is that possible? – Jasmin Hansen Mar 16 '20 at 17:04

This is not an attempt to solve a second order differential equation with LaTeX (even though it can be done). It is much easier to solve the differential equation analytically and to plot the solutions.

The equation
\[ y''+3y'+2y=0 \]
has the solution
where $a$ and $b$ are fixed by the boundary conditions. Demanding that
 y(0)=u\quad\text{and}\quad y'(0)=v
the solution becomes (cf.\ Figure~\ref{fig:sols})

\begin{tikzpicture}[declare function={%
    title={$y(0)=1$ and $y'(0)$ varies.}]
  {\addplot[color=blue,no marks,smooth] {ysol(x,1,#1)};}
    title={$y'(0)=1$ and $y(0)$ varies.}]
  {\addplot[color=blue,no marks,smooth] {ysol(x,#1,1)};}
\caption{Solutions of $y''+3y'+2y=0$.}

enter image description here


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.