2

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?

J. M.'s missing motivation
  • 124,525
  • 11
  • 401
  • 574
Jaigus
  • 257
  • 1
  • 6

1 Answers1

6
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

kglr
  • 394,356
  • 18
  • 477
  • 896