Tikz for f(x)=5x^2-2x and tangent line at 1,3

Click For Summary
SUMMARY

This discussion focuses on plotting the quadratic function $f(x)=5x^2-2x$ and its tangent line at the point (1,3) using TikZ. The tangent line is represented by the equation $8(x-1)+3$. Users express challenges with formatting in the forum's software, particularly with right alignment issues caused by the [right] command. A workaround involving additional spaces is suggested to address this formatting problem.

PREREQUISITES
  • Familiarity with TikZ for LaTeX
  • Understanding of quadratic functions and their derivatives
  • Knowledge of tangent lines and their equations
  • Basic LaTeX formatting skills
NEXT STEPS
  • Explore advanced TikZ features for enhanced plotting
  • Learn about LaTeX equation formatting techniques
  • Research methods for optimizing TikZ graphics for web display
  • Study the properties of quadratic functions and their graphical representations
USEFUL FOR

This discussion is beneficial for mathematicians, educators, and students interested in visualizing mathematical functions using TikZ, as well as anyone looking to improve their LaTeX skills for academic presentations.

karush
Gold Member
MHB
Messages
3,240
Reaction score
5
Code:
\begin{tikzpicture}[xscale=2,yscale=.5]
      \draw[->] (-1,0) -- (4,0) node[right] {$x$};
      \draw[->] (0,-1) -- (0,5) node[above] {$y$};
      \draw[scale=0.5,domain=-1:3.5,smooth,variable=\x,black] plot ({\x},{\x*\x});
  \end{tikzpicture}

ok I am actually trying to plot
$f(x)=5x^2-2x$
with the tangent line going thru $(1,3)$ which is $8\left(x-1\right)+3$

I thot I could just change this from an example but does seem to like it
stack exchange had some samples but they got very complex with other features added

anyway mahalo ahead
why is the preview right justified
 
Physics news on Phys.org
There is a [right] in there.
It's the one big issue TikZ has on this site.
The forum software has its own idea what to do with [right], which is to right align text.

The work-around is to add spaces and make it [ right ].
 
Last edited:
ok, more tomorrow Mahalo
 
basically got it... maybe some more info on it
I flattened it since it is too tall to show on LinkedIn

\begin{tikzpicture}[xscale=1,yscale=.1]
[help lines/.style={black!50,very thin}]
\draw[-,thin] (-1,0)--(1.5,0) node[below] {$x$};
\draw[-,thin] (0,-1)--(0,6) node[above] {$y$};
\node [below] at (1,0) {$1$};
\draw[very thick,color=black] plot [domain={-1}:{1.5},smooth]
(\x,{5*\x*\x-2*\x)});
\draw[thin,color=red] plot [domain={0}:{1.5},smooth]
(\x,{8*\x-5)});
\end{tikzpicture}
 
hi
 
Last edited:
want to improve to markup on this MHB posts that I get over a 1000 views
on the few that I have posted already got over 1100 view from LindedIn
start to put the MHB link for those interested in a forum
their are many students on IN from my alma mater APU
I read somewhere that linkedin is going to have an equation wirterView attachment 11842
 

Similar threads

  • · Replies 7 ·
Replies
7
Views
2K
Replies
6
Views
2K
Replies
5
Views
3K
  • · Replies 8 ·
Replies
8
Views
2K
  • · Replies 11 ·
Replies
11
Views
2K
  • · Replies 2 ·
Replies
2
Views
2K
  • · Replies 2 ·
Replies
2
Views
1K
  • · Replies 0 ·
Replies
0
Views
6K
  • · Replies 11 ·
Replies
11
Views
5K
  • · Replies 8 ·
Replies
8
Views
4K