Plot of y = \dfrac{4}{9}(x-3)(x+3)

  • Context:
  • Thread starter Thread starter karush
  • Start date Start date
  • Tags Tags
    Plot
Join the discussion
Ask a follow-up here, or get your own question answered by working scientists, mathematicians and engineers — people, not an autocomplete.
Real named experts · corrections over time · the nuance an AI answer skips
4 replies · 2K views
karush
Gold Member
MHB
Messages
3,240
Reaction score
5
$y = \dfrac{4}{9}(x-3)(x+3)$

ok I can't seem to write tikz to plot this

\begin{tikzpicture}[scale=0.50]
%preamble \usepackage{pgfplots}
\begin{axis}[xmin=-3.5, xmax=3.5, ymin=-5, ymax=5, axis lines=middle, ticks=none]
\addplot[
draw = black, smooth, ultra thick,
domain=-4:4,
] {exp((4/9)*(x^2-9)}
foreach \x in {-3,3} { (axis cs:{\x},0) node[below left] {\x} };
\end{axis}
\end{tikzpicture}
$y = \dfrac{4}{9}(x-3)(x+3)$
 
Physics news on Phys.org
this plots in overleaf but not here?ut\begin{tikzpicture}[xscale=1,yscale=1]
%preamble \usepackage{pgfplots}
\begin{axis}[xmin=-4, xmax=4, ymin=-5, ymax=5, axis lines=middle, ticks=none]
\addplot[draw = blue, smooth, ultra thick,domain=-4:4,] {(4/9)*(x^2-9))};
\draw[thin][fill][red] (-3,0) circle (.2);\node [below] at (-3.2,-.5) {(-3,0)};
\draw[thin][fill][red] (3,0) circle (.2);\node [below] at (3.2,-.5) {(3,0)};
\draw[thin][fill][red] (0,-4) circle (.2);\node
at (.3,-4.3) {(0,-4)};
\end{axis}
\end{tikzpicture}
$\boxed{y=\dfrac{4}{9}(x^2-9)}$​
 
sorry actually its this one...

$\boxed{y=\dfrac{4}{9}(x^2-9)}$
\begin{tikzpicture}[xscale=1,yscale=1]
%preamble \usepackage{pgfplots}
\begin{axis}[xmin=-4, xmax=4, ymin=-5, ymax=3, axis lines=middle, ticks=none]
\addplot[draw = blue, smooth, ultra thick,domain=-4:4,] {(4/9)*(x^2-9))};
\draw[thin][fill][red] (-3,0) circle (.2);\node [below] at (-3.2,-.5) {(-3,0)};
\draw[thin][fill][red] (3,0) circle (.2);\node [below] at (3.2,-.5) {(3,0)};
\draw[thin][fill][red] (0,-4) circle (.2);\node
at (.3,-4.3) {(0,-4)};
\end{axis}
\end{tikzpicture}​
 
karush said:
sorry actually its this one...

Unfortunately this forum treats [right] as a special code to align text to the right.
A work around is to use extra spaces and make it [ right ].
Then we get:

\begin{tikzpicture}[xscale=1,yscale=1]
%preamble \usepackage{pgfplots}
\begin{axis}[xmin=-4, xmax=4, ymin=-5, ymax=3, axis lines=middle, ticks=none]
\addplot[draw = blue, smooth, ultra thick,domain=-4:4,] {(4/9)*(x^2-9))};
\draw[thin][fill][red] (-3,0) circle (.2);\node [below] at (-3.2,-.5) {(-3,0)};
\draw[thin][fill][red] (3,0) circle (.2);\node [below] at (3.2,-.5) {(3,0)};
\draw[thin][fill][red] (0,-4) circle (.2);\node [ right ] at (.3,-4.3) {(0,-4)};
\end{axis}
\end{tikzpicture}