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

In summary, the conversation discusses plotting a function $f(x)=5x^2-2x$ and finding the tangent line at a given point. The individual also mentions encountering issues with right alignment in the forum software and plans to improve their posts on the forum. They also mention the potential for an equation writer feature on LinkedIn.
  • #1
karush
Gold Member
MHB
3,269
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
  • #2
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:
  • #3
ok, more tomorrow Mahalo
 
  • #4
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}
 
  • #5
hi
 
Last edited:
  • #6
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
 

1. What is Tikz?

Tikz is a free and open-source graphics package for creating diagrams and illustrations in LaTeX documents.

2. How can I graph a function in Tikz?

To graph a function in Tikz, you can use the "plot" command along with the function's equation and any desired formatting options.

3. How can I add a tangent line to a graph in Tikz?

To add a tangent line to a graph in Tikz, you can use the "addplot" command and specify the slope and point of tangency using the "tangent" option.

4. How do I graph a specific function in Tikz?

To graph a specific function in Tikz, you can use the "plot" command and input the equation of the function along with any desired formatting options.

5. Can I customize the appearance of my graph in Tikz?

Yes, you can customize the appearance of your graph in Tikz by using various formatting options such as color, line thickness, and axis labels.

Similar threads

  • MATLAB, Maple, Mathematica, LaTeX
Replies
6
Views
1K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
7
Views
957
  • MATLAB, Maple, Mathematica, LaTeX
Replies
8
Views
2K
  • Calculus and Beyond Homework Help
Replies
11
Views
1K
Replies
2
Views
1K
  • Calculus and Beyond Homework Help
Replies
11
Views
4K
  • MATLAB, Maple, Mathematica, LaTeX
Replies
1
Views
5K
  • Calculus and Beyond Homework Help
Replies
8
Views
3K
  • Calculus
Replies
4
Views
2K
Replies
3
Views
1K
Back
Top