What does this tool do?
This calculator differentiates a function the way the second year of the Moroccan bac asks for it (Sciences Maths and Sciences Expérimentales): polynomials, fractions, square root, ln, exponential, sin, cos, tan and their compositions. It writes each rule used as one step, with u, v, u′ and v′ filled in, then gives f′(x) in the form you would write in class.
It also gives the conditions (x ≠ 3, x > 0…), the value f′(a), the tangent line at x = a and the second derivative f″(x). The result is compared with the numeric slope of the curve at several points: at the slightest doubt, nothing is shown.
Use it to check an exercise and understand the method, before studying the sign of f′ with the function study or computing a limit.
How to use it
- Type the function with x as the variable, for example 3x² − 2x + 1, (2x + 1)/(x − 3), ln(x)/x, x·e^x or sqrt(x² + 1), or tap an example.
- Optional: enter a point a to get the value f′(a) and the tangent line, and tick “Show f″(x)” for the second derivative.
- Read the derivative and the conditions, then the detailed solution: one step per rule used, like a corrected exercise.
Write 2x for 2 × x, 3(x + 1) for 3 × (x + 1), x^2 or x² for a power, sqrt(x) or √(x) for the root, e^x or exp(x), ln(x). Angles are in radians. The Share button copies a link with the same function and point.
Calculation method
(uv)′ = u′v + uv′ · (u/v)′ = (u′v − uv′)/v² · (1/v)′ = −v′/v² · (uⁿ)′ = n·u′·uⁿ⁻¹
(√u)′ = u′/(2√u) · (ln u)′ = u′/u · (e^u)′ = u′·e^u
(sin u)′ = u′·cos u · (cos u)′ = −u′·sin u · (tan u)′ = u′(1 + tan² u)
Tangent line at a: y = f′(a)(x − a) + f(a)
With (uv)′ and (u/v)′ you first set u and v, then work out u′ and v′. For a composite function such as √(3x² + 1), take u = 3x² + 1: (√u)′ = u′/(2√u) = 6x/(2√(3x² + 1)) = 3x/√(3x² + 1). The result is then simplified: like terms collected, numerator expanded, common factors pulled out.
The conditions come from the function: a denominator must be non-zero, and the argument of ln or √ must be strictly positive. When the expression has degree 1 the condition is solved (2x − 1 > 0 gives x > 1/2); otherwise it is written as it is, for example x² − 4 > 0.
The value f′(a) is the slope of the tangent at the point with abscissa a. The tangent line is y = f′(a)(x − a) + f(a), simplified to y = mx + p with exact values (fractions, e, ln 2…) whenever possible.
Worked example
Example 1: f(x) = (2x + 1)/(x − 3) at the point a = 4
- Condition: x − 3 ≠ 0, so f is differentiable on ℝ∖{3}.
- Set u = 2x + 1 and v = x − 3, so u′ = 2 and v′ = 1.
- Quotient: f′(x) = (u′v − uv′)/v² = (2(x − 3) − (2x + 1))/(x − 3)² = −7/(x − 3)².
- At a = 4: f(4) = 9 and f′(4) = −7.
- Tangent: y = f′(4)(x − 4) + f(4) = −7(x − 4) + 9 = −7x + 37.
f′(x) = −7/(x − 3)², and (T): y = −7x + 37.
Another scenario: f(x) = x·e^x at the point a = 0
- f is differentiable on ℝ. Set u = x and v = e^x, so u′ = 1 and v′ = e^x.
- Product: f′(x) = u′v + uv′ = e^x + x·e^x = (x + 1)e^x.
- At a = 0: f(0) = 0 and f′(0) = 1, so (T): y = x.
- Second derivative: differentiate (x + 1)e^x with the same product rule, f″(x) = e^x + (x + 1)e^x = (x + 2)e^x, and f″(0) = 2.
f′(x) = (x + 1)e^x, f″(x) = (x + 2)e^x and (T): y = x.
Understanding the results
Derivative at a point and tangent
The value f′(a) is the limit of the rate of change (f(x) − f(a))/(x − a) as x tends to a. On the graph it is the slope of the tangent at a. If f′(a) = 0, the tangent is horizontal.
Differentiability and domain
A function is differentiable only where it is defined and where the rules apply. The function √x is defined at 0 but not differentiable there: f′(x) = 1/(2√x) exists only for x > 0.
Sign of the derivative
If f′ > 0 on an interval, f is strictly increasing; if f′ < 0, it is strictly decreasing; if f′ vanishes and changes sign, f has an extremum. Computing limits completes the study at the ends of the domain.
Second derivative
f″ is the derivative of f′. If f″ > 0 the curve is convex (above its tangents); if f″ vanishes and changes sign, the curve has an inflection point.
Tips and limitations
- Always check the conditions: the derivative of ln(x) only makes sense for x > 0.
- To compare with your own answer, expand or factor: (x + 1)e^x and x·e^x + e^x are equal.
- For an antiderivative or an area, use the integral calculator: integrating is the reverse of differentiating.
- The result is exact (fractions, e, ln); a decimal value is marked ≈. The tool helps you check, but writing the answer in the exam is still up to you.
Mistakes to avoid
- Forgetting the factor u′ for a composite function: (e^(2x))′ = 2e^(2x), not e^(2x).
- Writing (uv)′ = u′v′: the correct formula is u′v + uv′.
- Swapping the numerator of a quotient: it is u′v − uv′, in that order.
- Differentiating ln(x²) as 1/x²: the correct derivative is 2x/x² = 2/x.
Frequently asked questions
How do I differentiate a quotient?
Set u and v, then use (u/v)′ = (u′v − uv′)/v². For f(x) = (2x + 1)/(x − 3): u′ = 2 and v′ = 1, so f′(x) = (2(x − 3) − (2x + 1))/(x − 3)² = −7/(x − 3)², for x ≠ 3.
How do I find the tangent line?
At x = a it is y = f′(a)(x − a) + f(a). For f(x) = x² at a = 1: f(1) = 1 and f′(1) = 2, so y = 2(x − 1) + 1 = 2x − 1.
What is the derivative of ln u and e^u?
(ln u)′ = u′/u with u > 0, and (e^u)′ = u′·e^u. For example (ln(2x − 1))′ = 2/(2x − 1) and (e^(2x + 1))′ = 2e^(2x + 1).
What if the derivative does not appear?
Check the syntax: a missing bracket or an unknown word is reported under the box. Write ln for the natural logarithm; “log” is refused because it is ambiguous.
Why does f′(a) not exist?
Because f or f′ is not defined at a, like 1/x at 0 or √x at 0. There is then no derivative value and no tangent line at that point.
Can I trust the results?
Every derivative is compared with the numeric slope of f at several points; if the gap is too large, the calculation is refused and nothing is shown.