Tool to calculate the tangent to a curve, to a function, at a given point (infinity close to this point) and to find its tangent line equation as a function of the variable x.
Tangent to a Curve - dCode
Tag(s) : Geometry
dCode is free and its tools are a valuable help in games, maths, geocaching, puzzles and problems to solve every day!
A suggestion ? a feedback ? a bug ? an idea ? Write to dCode!
In geometry, a tangent to a curve is a straight line that approaches / caresses / touches the curve at this point so as to form an angle equal to 0.
The equation of the tangent at $ x = a $ is calculated from the equation of the curve $ f(x) $, by applying a limit calculation and a derivative calculation.
Calculate the limit $$ \lim_{h \to 0} \frac{f(a+h)-f(a)}{h} $$
If the limit is indeterminate, then there is no tangent at this point (the function is not differentiable in $ x = a $)
If the limit is infinite ($ +\infty $ or $ -\infty $), then the line of equation $ x = a $ is a tangent in $ a $ (and also an asymptote)
Otherwise (the limit is finite, it has a value) then calculate $ f'(x) $ the derivative of $ f (x) $ in order to obtain the equation of the tangent in $ a $ which is defined by the formula $$ y = (x-a) \times f'(a) + f(a) $$
Example: Determinate the tangent equation of $ f(x) = x^2 $ at the point $ x = 1 $, first calculate the limit $$ \lim_{h \to 0} \frac{(1+h)^2-1^2}{h} = \lim_{h \to 0} \frac{2h+h^2}{h} = \lim_{h \to 0} 2+h = 2 $$ this limit is therefore finite, the function is differentiable and its derivative is $ f'(x) = 2x $, so the tangent equation is $$ y = (x-a) \times f'(a) + f(a) \\ y = (x-1) \cdot 2 \cdot 1 + 1^2 \\ y = 2x-2+1 \\ y = 2x-1 $$
If it is already known that the function is differentiable in $ a $, then the calculation of the limit is not necessary and the formula can be applied directly.
dCode retains ownership of the "Tangent to a Curve" source code. Any algorithm for the "Tangent to a Curve" algorithm, applet or snippet or script (converter, solver, encryption / decryption, encoding / decoding, ciphering / deciphering, breaker, translator), or any "Tangent to a Curve" functions (calculate, convert, solve, decrypt / encrypt, decipher / cipher, decode / encode, translate) written in any informatic language (Python, Java, PHP, C#, Javascript, Matlab, etc.) or any database download or API access for "Tangent to a Curve" or any other element are not public (except explicit open source licence). Same with the download for offline use on PC, mobile, tablet, iPhone or Android app.
Reminder: dCode is an educational and teaching resource, accessible online for free and for everyone.
The content of the page "Tangent to a Curve" and its results may be freely copied and reused, including for commercial purposes, provided that dCode.fr is cited as the source (Creative Commons CC-BY free distribution license).
Exporting the results is free and can be done simply by clicking on the export icons ⤓ (.csv or .txt format) or ⧉ (copy and paste).
To cite dCode.fr on another website, use the link:
In a scientific article or book, the recommended bibliographic citation is: Tangent to a Curve on dCode.fr [online website], retrieved on 2025-06-15,