-1

enter image description here Sorry, I am new to LaTeX. How can I make this figure or something similar from Nagle's Differential Equations book in a TikZ code?

New contributor
Carlos Eduardo Velez Cantos is a new contributor to this site. Take care in asking for clarification, commenting, and answering. Check out our Code of Conduct.
4
  • 6
    Welcome to TeX SE. Have you tried something? If so, where did you get stuck? Could you edit your post to add what you tried. May 15 at 16:06
  • \pgfplots could be right tool. Just define domain of function, left and right border of rectangle, bottom and above border with value of function ad left and right border. If you will stuck at this, ask what is your problem.
    – Zarko
    May 15 at 16:50
  • 3
    Do you need the exact function there? Otherwise, it is probably easiest to approximate and just draw some curve with TikZ. But as others already said: Please show what you tried so far. There are lots of examples on this site and on other sites, and the online TikZ manual has some great tutorials ... Please understand that this site is not meant to be a free, human-powered image-to-TikZ conversion tool. May 15 at 16:51
  • 1
    Welcome. // You can draw most of it using Tikz, where you look up \draw, rectangle, fill, \node, anchor and circle (for the dots). In hindsight it will be no big deal. We are looking forward to your code, even with imperfections, so we can guide you a bit more specifically.
    – MS-SPO
    2 days ago

1 Answer 1

2

A drawing similar to original is that done with my fingers using Mathcha:

\documentclass[12pt]{article}
\usepackage{newtxtext,newtxmath}
\usepackage{tikz}
\begin{document}
\tikzset{every picture/.style={line width=0.75pt}} %set default line width to 0.75pt        
\begin{tikzpicture}[x=0.75pt,y=0.75pt,yscale=-1,xscale=1]
%uncomment if require: \path (0,422); %set diagram left start at 0, and has height of 422
%Shape: Rectangle [id:dp7969338238081014] 
\draw  [color={rgb, 255:red, 120; green, 120; blue, 120 }  ,draw opacity=1 ][fill={rgb, 255:red, 203; green, 203; blue, 203 }  ,fill opacity=1 ][line width=2.25]  (211.52,91.13) -- (364.47,91.13) -- (364.47,178.53) -- (211.52,178.53) -- cycle ;
%Straight Lines [id:da5556239369938141] 
\draw  [dash pattern={on 4.5pt off 4.5pt}]  (318.87,239.24) -- (318.87,93.13) ;
%Straight Lines [id:da03381888126954813] 
\draw    (112,239) -- (453,239) ;
\draw [shift={(456,239)}, rotate = 180] [fill={rgb, 255:red, 0; green, 0; blue, 0 }  ][line width=0.08]  [draw opacity=0] (10.72,-5.15) -- (0,0) -- (10.72,5.15) -- (7.12,0) -- cycle    ;
%Straight Lines [id:da8017922937238566] 
\draw    (112,239) -- (112,43.6) ;
\draw [shift={(112,40.6)}, rotate = 90] [fill={rgb, 255:red, 0; green, 0; blue, 0 }  ][line width=0.08]  [draw opacity=0] (10.72,-5.15) -- (0,0) -- (10.72,5.15) -- (7.12,0) -- cycle    ;
%Straight Lines [id:da06744441172980142] 
\draw    (103.05,90.6) -- (124.05,90.6) ;
%Straight Lines [id:da07348448335391122] 
\draw    (103.05,178) -- (124.05,178) ;
%Straight Lines [id:da5541560604948685] 
\draw    (102.5,139.8) -- (123.5,139.8) ;
%Straight Lines [id:da6454802723956783] 
\draw    (210.05,247.77) -- (210.05,228) ;
%Straight Lines [id:da385121193786931] 
\draw    (363,248.77) -- (363,229) ;
%Shape: Circle [id:dp1851342589265894] 
\draw  [fill={rgb, 255:red, 0; green, 0; blue, 0 }  ,fill opacity=1 ] (236.74,239.24) .. controls (236.74,236.96) and (238.59,235.11) .. (240.87,235.11) .. controls (243.15,235.11) and (245,236.96) .. (245,239.24) .. controls (245,241.52) and (243.15,243.37) .. (240.87,243.37) .. controls (238.59,243.37) and (236.74,241.52) .. (236.74,239.24) -- cycle ;
%Shape: Circle [id:dp8718775696384773] 
\draw  [fill={rgb, 255:red, 0; green, 0; blue, 0 }  ,fill opacity=1 ] (275.74,239) .. controls (275.74,236.72) and (277.59,234.87) .. (279.87,234.87) .. controls (282.15,234.87) and (284,236.72) .. (284,239) .. controls (284,241.28) and (282.15,243.13) .. (279.87,243.13) .. controls (277.59,243.13) and (275.74,241.28) .. (275.74,239) -- cycle ;
%Shape: Circle [id:dp5850245293878551] 
\draw  [fill={rgb, 255:red, 0; green, 0; blue, 0 }  ,fill opacity=1 ] (314.74,239.24) .. controls (314.74,236.96) and (316.59,235.11) .. (318.87,235.11) .. controls (321.15,235.11) and (323,236.96) .. (323,239.24) .. controls (323,241.52) and (321.15,243.37) .. (318.87,243.37) .. controls (316.59,243.37) and (314.74,241.52) .. (314.74,239.24) -- cycle ;
%Straight Lines [id:da950273910720159] 
\draw  [dash pattern={on 4.5pt off 4.5pt}]  (114,139.8) -- (279.47,139.8) ;
%Curve Lines [id:da34290520588797935] 
\draw [color={rgb, 255:red, 149; green, 145; blue, 145 }  ,draw opacity=1 ][line width=2.15]    (240.87,177.13) .. controls (296.47,135.13) and (291.47,88.13) .. (364.47,91.13) ;
%Shape: Circle [id:dp5363421565417101] 
\draw  [fill={rgb, 255:red, 0; green, 0; blue, 0 }  ,fill opacity=1 ] (273.21,138.8) .. controls (273.21,136.52) and (275.06,134.67) .. (277.34,134.67) .. controls (279.62,134.67) and (281.47,136.52) .. (281.47,138.8) .. controls (281.47,141.08) and (279.62,142.93) .. (277.34,142.93) .. controls (275.06,142.93) and (273.21,141.08) .. (273.21,138.8) -- cycle ;
%Straight Lines [id:da3994812630687161] 
\draw  [dash pattern={on 4.5pt off 4.5pt}]  (240.87,239.24) -- (240.87,177.13) ;
%Straight Lines [id:da858097360122009] 
\draw  [dash pattern={on 4.5pt off 4.5pt}]  (279.87,239) -- (279.87,138.8) ;
%Curve Lines [id:da367371041978948] 
\draw    (308.47,147.13) .. controls (305.59,133.69) and (302.71,144.21) .. (298.94,122.96) ;
\draw [shift={(298.47,120.13)}, rotate = 80.91] [fill={rgb, 255:red, 0; green, 0; blue, 0 }  ][line width=0.08]  [draw opacity=0] (10.72,-5.15) -- (0,0) -- (10.72,5.15) -- (7.12,0) -- cycle    ;

% Text Node
\draw  [draw opacity=0]  (279.9,139.37) -- (347.9,139.37) -- (347.9,162.37) -- (279.9,162.37) -- cycle  ;
\draw (310,150.87) node    {$y=\phi(x)$};
% Text Node
\draw (205,249) node [anchor=north west][inner sep=0.75pt]    {$a$};
% Text Node
\draw (359,249) node [anchor=north west][inner sep=0.75pt]    {$b$};
% Text Node
\draw (220,249) node [anchor=north west][inner sep=0.75pt]    {$x_{0} -\delta $};
% Text Node
\draw (310,249) node [anchor=north west][inner sep=0.75pt]    {$x_{0} +\delta $};
% Text Node
\draw (273,249) node [anchor=north west][inner sep=0.75pt]    {$x_{0}$};
% Text Node
\draw (86,168.13) node [anchor=north west][inner sep=0.75pt]    {$c$};
% Text Node
\draw (86,80.13) node [anchor=north west][inner sep=0.75pt]    {$d$};
% Text Node
\draw (86,130.13) node [anchor=north west][inner sep=0.75pt]    {$y_{0}$};
% Text Node
\draw (446,243.13) node [anchor=north west][inner sep=0.75pt]    {$x$};
% Text Node
\draw (92,33.13) node [anchor=north west][inner sep=0.75pt]    {$y$};
\end{tikzpicture}
\end{document}

enter image description here

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .