How do I draw a function along with a particular tangent line at a specific point? [duplicate]

The name of the pictureThe name of the pictureThe name of the pictureClash Royale CLAN TAG#URR8PPP












1












$begingroup$



This question already has an answer here:



  • Equation of a line that is tangent to a curve at point

    2 answers



I would like to draw a function (x/x^2+1), and at a certain point, i'd like to draw a dot along with the tangent line at that specific point.



what I have tried is the following:



Plot[function[x], function'[x], x, -5, 5, AxesLabel -> x, y LabelStyle -> Direction[Black, Bold]]


However, this plots the original function f(x) and f'(x) simultaneously; how can I achieve the desired result?










share|improve this question











$endgroup$



marked as duplicate by J. M. is slightly pensive plotting
Users with the  plotting badge can single-handedly close plotting questions as duplicates and reopen them as needed.

StackExchange.ready(function()
if (StackExchange.options.isMobile) return;

$('.dupe-hammer-message-hover:not(.hover-bound)').each(function()
var $hover = $(this).addClass('hover-bound'),
$msg = $hover.siblings('.dupe-hammer-message');

$hover.hover(
function()
$hover.showInfoMessage('',
messageElement: $msg.clone().show(),
transient: false,
position: my: 'bottom left', at: 'top center', offsetTop: -7 ,
dismissable: false,
relativeToBody: true
);
,
function()
StackExchange.helpers.removeMessages();

);
);
);
Mar 13 at 2:19


This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

















  • $begingroup$
    Duplicate: mathematica.stackexchange.com/questions/87375/…, which is a duplicate of mathematica.stackexchange.com/questions/18090/…
    $endgroup$
    – Michael E2
    Feb 25 at 4:38










  • $begingroup$
    Also this thread.
    $endgroup$
    – J. M. is slightly pensive
    Feb 25 at 7:06















1












$begingroup$



This question already has an answer here:



  • Equation of a line that is tangent to a curve at point

    2 answers



I would like to draw a function (x/x^2+1), and at a certain point, i'd like to draw a dot along with the tangent line at that specific point.



what I have tried is the following:



Plot[function[x], function'[x], x, -5, 5, AxesLabel -> x, y LabelStyle -> Direction[Black, Bold]]


However, this plots the original function f(x) and f'(x) simultaneously; how can I achieve the desired result?










share|improve this question











$endgroup$



marked as duplicate by J. M. is slightly pensive plotting
Users with the  plotting badge can single-handedly close plotting questions as duplicates and reopen them as needed.

StackExchange.ready(function()
if (StackExchange.options.isMobile) return;

$('.dupe-hammer-message-hover:not(.hover-bound)').each(function()
var $hover = $(this).addClass('hover-bound'),
$msg = $hover.siblings('.dupe-hammer-message');

$hover.hover(
function()
$hover.showInfoMessage('',
messageElement: $msg.clone().show(),
transient: false,
position: my: 'bottom left', at: 'top center', offsetTop: -7 ,
dismissable: false,
relativeToBody: true
);
,
function()
StackExchange.helpers.removeMessages();

);
);
);
Mar 13 at 2:19


This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

















  • $begingroup$
    Duplicate: mathematica.stackexchange.com/questions/87375/…, which is a duplicate of mathematica.stackexchange.com/questions/18090/…
    $endgroup$
    – Michael E2
    Feb 25 at 4:38










  • $begingroup$
    Also this thread.
    $endgroup$
    – J. M. is slightly pensive
    Feb 25 at 7:06













1












1








1





$begingroup$



This question already has an answer here:



  • Equation of a line that is tangent to a curve at point

    2 answers



I would like to draw a function (x/x^2+1), and at a certain point, i'd like to draw a dot along with the tangent line at that specific point.



what I have tried is the following:



Plot[function[x], function'[x], x, -5, 5, AxesLabel -> x, y LabelStyle -> Direction[Black, Bold]]


However, this plots the original function f(x) and f'(x) simultaneously; how can I achieve the desired result?










share|improve this question











$endgroup$





This question already has an answer here:



  • Equation of a line that is tangent to a curve at point

    2 answers



I would like to draw a function (x/x^2+1), and at a certain point, i'd like to draw a dot along with the tangent line at that specific point.



what I have tried is the following:



Plot[function[x], function'[x], x, -5, 5, AxesLabel -> x, y LabelStyle -> Direction[Black, Bold]]


However, this plots the original function f(x) and f'(x) simultaneously; how can I achieve the desired result?





This question already has an answer here:



  • Equation of a line that is tangent to a curve at point

    2 answers







plotting calculus-and-analysis functions






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Feb 25 at 2:04









J. M. is slightly pensive

98.1k10306465




98.1k10306465










asked Feb 24 at 5:38









JaigusJaigus

1775




1775




marked as duplicate by J. M. is slightly pensive plotting
Users with the  plotting badge can single-handedly close plotting questions as duplicates and reopen them as needed.

StackExchange.ready(function()
if (StackExchange.options.isMobile) return;

$('.dupe-hammer-message-hover:not(.hover-bound)').each(function()
var $hover = $(this).addClass('hover-bound'),
$msg = $hover.siblings('.dupe-hammer-message');

$hover.hover(
function()
$hover.showInfoMessage('',
messageElement: $msg.clone().show(),
transient: false,
position: my: 'bottom left', at: 'top center', offsetTop: -7 ,
dismissable: false,
relativeToBody: true
);
,
function()
StackExchange.helpers.removeMessages();

);
);
);
Mar 13 at 2:19


This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.









marked as duplicate by J. M. is slightly pensive plotting
Users with the  plotting badge can single-handedly close plotting questions as duplicates and reopen them as needed.

StackExchange.ready(function()
if (StackExchange.options.isMobile) return;

$('.dupe-hammer-message-hover:not(.hover-bound)').each(function()
var $hover = $(this).addClass('hover-bound'),
$msg = $hover.siblings('.dupe-hammer-message');

$hover.hover(
function()
$hover.showInfoMessage('',
messageElement: $msg.clone().show(),
transient: false,
position: my: 'bottom left', at: 'top center', offsetTop: -7 ,
dismissable: false,
relativeToBody: true
);
,
function()
StackExchange.helpers.removeMessages();

);
);
);
Mar 13 at 2:19


This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.













  • $begingroup$
    Duplicate: mathematica.stackexchange.com/questions/87375/…, which is a duplicate of mathematica.stackexchange.com/questions/18090/…
    $endgroup$
    – Michael E2
    Feb 25 at 4:38










  • $begingroup$
    Also this thread.
    $endgroup$
    – J. M. is slightly pensive
    Feb 25 at 7:06
















  • $begingroup$
    Duplicate: mathematica.stackexchange.com/questions/87375/…, which is a duplicate of mathematica.stackexchange.com/questions/18090/…
    $endgroup$
    – Michael E2
    Feb 25 at 4:38










  • $begingroup$
    Also this thread.
    $endgroup$
    – J. M. is slightly pensive
    Feb 25 at 7:06















$begingroup$
Duplicate: mathematica.stackexchange.com/questions/87375/…, which is a duplicate of mathematica.stackexchange.com/questions/18090/…
$endgroup$
– Michael E2
Feb 25 at 4:38




$begingroup$
Duplicate: mathematica.stackexchange.com/questions/87375/…, which is a duplicate of mathematica.stackexchange.com/questions/18090/…
$endgroup$
– Michael E2
Feb 25 at 4:38












$begingroup$
Also this thread.
$endgroup$
– J. M. is slightly pensive
Feb 25 at 7:06




$begingroup$
Also this thread.
$endgroup$
– J. M. is slightly pensive
Feb 25 at 7:06










1 Answer
1






active

oldest

votes


















5












$begingroup$

function[x_] := x/(x^2 + 1);

x0 = 1/2;
Plot[function[x], function[x0] + function'[x0] (x - x0), x, -5, 5,
AxesLabel -> x, y, LabelStyle -> Direction[Black, Bold],
Mesh -> x0, MeshStyle -> Directive[Red, PointSize[Large]]]


enter image description here






share|improve this answer











$endgroup$












  • $begingroup$
    Hey thanks! I'm trying to plot this at point 45, but it doesn't seem to plot the tangent at that point; instead the tangent is on a completely different line with two dots?
    $endgroup$
    – Jaigus
    Feb 24 at 6:50










  • $begingroup$
    @Jaigus, there was a typo; fixed now. Mesh -> 1/2 should be Mesh -> x0.
    $endgroup$
    – kglr
    Feb 24 at 7:12










  • $begingroup$
    Thanks alot, this works great.
    $endgroup$
    – Jaigus
    Feb 24 at 7:25






  • 1




    $begingroup$
    Alternatively: Plot[function[x], Normal[Series[function[x], x, x0, 1]] // Evaluate, x, -5, 5].
    $endgroup$
    – J. M. is slightly pensive
    Feb 25 at 2:04










  • $begingroup$
    @J.M.iscomputer-less, that's much neater.
    $endgroup$
    – kglr
    Feb 25 at 7:04

















1 Answer
1






active

oldest

votes








1 Answer
1






active

oldest

votes









active

oldest

votes






active

oldest

votes









5












$begingroup$

function[x_] := x/(x^2 + 1);

x0 = 1/2;
Plot[function[x], function[x0] + function'[x0] (x - x0), x, -5, 5,
AxesLabel -> x, y, LabelStyle -> Direction[Black, Bold],
Mesh -> x0, MeshStyle -> Directive[Red, PointSize[Large]]]


enter image description here






share|improve this answer











$endgroup$












  • $begingroup$
    Hey thanks! I'm trying to plot this at point 45, but it doesn't seem to plot the tangent at that point; instead the tangent is on a completely different line with two dots?
    $endgroup$
    – Jaigus
    Feb 24 at 6:50










  • $begingroup$
    @Jaigus, there was a typo; fixed now. Mesh -> 1/2 should be Mesh -> x0.
    $endgroup$
    – kglr
    Feb 24 at 7:12










  • $begingroup$
    Thanks alot, this works great.
    $endgroup$
    – Jaigus
    Feb 24 at 7:25






  • 1




    $begingroup$
    Alternatively: Plot[function[x], Normal[Series[function[x], x, x0, 1]] // Evaluate, x, -5, 5].
    $endgroup$
    – J. M. is slightly pensive
    Feb 25 at 2:04










  • $begingroup$
    @J.M.iscomputer-less, that's much neater.
    $endgroup$
    – kglr
    Feb 25 at 7:04















5












$begingroup$

function[x_] := x/(x^2 + 1);

x0 = 1/2;
Plot[function[x], function[x0] + function'[x0] (x - x0), x, -5, 5,
AxesLabel -> x, y, LabelStyle -> Direction[Black, Bold],
Mesh -> x0, MeshStyle -> Directive[Red, PointSize[Large]]]


enter image description here






share|improve this answer











$endgroup$












  • $begingroup$
    Hey thanks! I'm trying to plot this at point 45, but it doesn't seem to plot the tangent at that point; instead the tangent is on a completely different line with two dots?
    $endgroup$
    – Jaigus
    Feb 24 at 6:50










  • $begingroup$
    @Jaigus, there was a typo; fixed now. Mesh -> 1/2 should be Mesh -> x0.
    $endgroup$
    – kglr
    Feb 24 at 7:12










  • $begingroup$
    Thanks alot, this works great.
    $endgroup$
    – Jaigus
    Feb 24 at 7:25






  • 1




    $begingroup$
    Alternatively: Plot[function[x], Normal[Series[function[x], x, x0, 1]] // Evaluate, x, -5, 5].
    $endgroup$
    – J. M. is slightly pensive
    Feb 25 at 2:04










  • $begingroup$
    @J.M.iscomputer-less, that's much neater.
    $endgroup$
    – kglr
    Feb 25 at 7:04













5












5








5





$begingroup$

function[x_] := x/(x^2 + 1);

x0 = 1/2;
Plot[function[x], function[x0] + function'[x0] (x - x0), x, -5, 5,
AxesLabel -> x, y, LabelStyle -> Direction[Black, Bold],
Mesh -> x0, MeshStyle -> Directive[Red, PointSize[Large]]]


enter image description here






share|improve this answer











$endgroup$



function[x_] := x/(x^2 + 1);

x0 = 1/2;
Plot[function[x], function[x0] + function'[x0] (x - x0), x, -5, 5,
AxesLabel -> x, y, LabelStyle -> Direction[Black, Bold],
Mesh -> x0, MeshStyle -> Directive[Red, PointSize[Large]]]


enter image description here







share|improve this answer














share|improve this answer



share|improve this answer








edited Feb 24 at 7:11

























answered Feb 24 at 6:05









kglrkglr

189k10206424




189k10206424











  • $begingroup$
    Hey thanks! I'm trying to plot this at point 45, but it doesn't seem to plot the tangent at that point; instead the tangent is on a completely different line with two dots?
    $endgroup$
    – Jaigus
    Feb 24 at 6:50










  • $begingroup$
    @Jaigus, there was a typo; fixed now. Mesh -> 1/2 should be Mesh -> x0.
    $endgroup$
    – kglr
    Feb 24 at 7:12










  • $begingroup$
    Thanks alot, this works great.
    $endgroup$
    – Jaigus
    Feb 24 at 7:25






  • 1




    $begingroup$
    Alternatively: Plot[function[x], Normal[Series[function[x], x, x0, 1]] // Evaluate, x, -5, 5].
    $endgroup$
    – J. M. is slightly pensive
    Feb 25 at 2:04










  • $begingroup$
    @J.M.iscomputer-less, that's much neater.
    $endgroup$
    – kglr
    Feb 25 at 7:04
















  • $begingroup$
    Hey thanks! I'm trying to plot this at point 45, but it doesn't seem to plot the tangent at that point; instead the tangent is on a completely different line with two dots?
    $endgroup$
    – Jaigus
    Feb 24 at 6:50










  • $begingroup$
    @Jaigus, there was a typo; fixed now. Mesh -> 1/2 should be Mesh -> x0.
    $endgroup$
    – kglr
    Feb 24 at 7:12










  • $begingroup$
    Thanks alot, this works great.
    $endgroup$
    – Jaigus
    Feb 24 at 7:25






  • 1




    $begingroup$
    Alternatively: Plot[function[x], Normal[Series[function[x], x, x0, 1]] // Evaluate, x, -5, 5].
    $endgroup$
    – J. M. is slightly pensive
    Feb 25 at 2:04










  • $begingroup$
    @J.M.iscomputer-less, that's much neater.
    $endgroup$
    – kglr
    Feb 25 at 7:04















$begingroup$
Hey thanks! I'm trying to plot this at point 45, but it doesn't seem to plot the tangent at that point; instead the tangent is on a completely different line with two dots?
$endgroup$
– Jaigus
Feb 24 at 6:50




$begingroup$
Hey thanks! I'm trying to plot this at point 45, but it doesn't seem to plot the tangent at that point; instead the tangent is on a completely different line with two dots?
$endgroup$
– Jaigus
Feb 24 at 6:50












$begingroup$
@Jaigus, there was a typo; fixed now. Mesh -> 1/2 should be Mesh -> x0.
$endgroup$
– kglr
Feb 24 at 7:12




$begingroup$
@Jaigus, there was a typo; fixed now. Mesh -> 1/2 should be Mesh -> x0.
$endgroup$
– kglr
Feb 24 at 7:12












$begingroup$
Thanks alot, this works great.
$endgroup$
– Jaigus
Feb 24 at 7:25




$begingroup$
Thanks alot, this works great.
$endgroup$
– Jaigus
Feb 24 at 7:25




1




1




$begingroup$
Alternatively: Plot[function[x], Normal[Series[function[x], x, x0, 1]] // Evaluate, x, -5, 5].
$endgroup$
– J. M. is slightly pensive
Feb 25 at 2:04




$begingroup$
Alternatively: Plot[function[x], Normal[Series[function[x], x, x0, 1]] // Evaluate, x, -5, 5].
$endgroup$
– J. M. is slightly pensive
Feb 25 at 2:04












$begingroup$
@J.M.iscomputer-less, that's much neater.
$endgroup$
– kglr
Feb 25 at 7:04




$begingroup$
@J.M.iscomputer-less, that's much neater.
$endgroup$
– kglr
Feb 25 at 7:04


Popular posts from this blog

How to check contact read email or not when send email to Individual?

Displaying single band from multi-band raster using QGIS

How many registers does an x86_64 CPU actually have?