AP Calculus BC • Analytical Applications of Differentiation

Connecting a Function, Its First Derivative, and Its Second Derivative

Understand how f, f′, and f″ jointly reveal a function's behavior, shape, and turning points.

AP Calculus BC illustration with summation, combined graphs, and an orbit
Inside this lesson 10 sections 5 questions 9 figures

SECTION 1

Historical Context & Motivation

The relationship between a function and its derivatives is one of the central pillars of calculus, and its development spans several centuries of mathematical innovation. Before the formal apparatus of calculus existed, natural philosophers grappled with questions about motion, curvature, and the behavior of changing quantities. The idea that the rate of change of a rate of change conveys meaningful geometric information—what we now call the second derivative—was not obvious, and its formalization required the combined insights of Newton, Leibniz, Euler, and many others. Understanding this historical arc helps illuminate why connecting f, f′, and f″ is so powerful: it transforms a static equation into a dynamic portrait of shape, direction, and curvature.

1665–1666 • Newton's Fluxions

Isaac Newton develops his method of fluxions during the plague years, introducing the notion that a quantity's instantaneous rate of change (the 'fluxion') and the rate of change of that fluxion carry distinct geometric meaning—foreshadowing the first and second derivative.

1684 • Leibniz Publishes Nova Methodus

Gottfried Wilhelm Leibniz publishes his differential calculus, introducing the dy/dx notation still used today. His framework makes iterated differentiation (d²y/dx²) notationally transparent and computationally accessible.

1748 • Euler's Introductio in Analysin Infinitorum

Leonhard Euler systematically classifies curves by their concavity behavior, explicitly linking the sign of the second derivative to whether a curve bends upward or downward—laying the foundation for the concavity tests used in modern calculus courses.

1823 • Cauchy's Cours d'Analyse

Augustin-Louis Cauchy rigorously defines limits, continuity, and differentiability, placing the first and second derivative tests on a firm logical foundation. His work ensures that the connections between f, f′, and f″ are provable theorems rather than geometric intuitions.

The central question this topic addresses is deceptively simple: given information about one of the three related objects—f, f′, or f″—what can we deduce about the other two? On the AP Calculus BC exam, this question appears in multiple guises: you may be given a graph of f′ and asked where f has a local maximum, or you may be given a table of f″ values and asked about the concavity of f. Mastering these connections allows you to move fluidly between algebraic, graphical, and numerical representations, which is precisely what the exam demands.

SECTION 2

Core Principles & Definitions

The relationship among f, f′, and f″ is governed by a handful of foundational principles. Each derivative peels back a layer of behavioral information: the first derivative reveals where the function increases or decreases and identifies critical points, while the second derivative exposes the curvature—whether the graph bends upward (concave up) or downward (concave down)—and locates inflection points where that curvature changes sign. Together, these layers produce a complete qualitative sketch of any sufficiently smooth function.

1

Monotonicity via f′

If f′(x) > 0 on an interval, then f is increasing there. If f′(x) < 0, f is decreasing. Where f′(x) = 0 or is undefined, f has a critical point.
2

Concavity via f″

If f″(x) > 0 on an interval, f is concave up (holds water). If f″(x) < 0, f is concave down (spills water). This determines the shape of the curve between critical points.
3

First Derivative Test

At a critical point c: if f′ changes from positive to negative, f has a local maximum; if f′ changes from negative to positive, f has a local minimum; if f′ does not change sign, c is neither.
4

Second Derivative Test

At a critical point c where f′(c) = 0: if f″(c) > 0, f has a local minimum; if f″(c) < 0, f has a local maximum; if f″(c) = 0, the test is inconclusive.
5

Inflection Points

An inflection point occurs where f″ changes sign—the curve transitions between concave up and concave down. At an inflection point, f″ = 0 or f″ is undefined, but the converse is not always true.
✦

KEY TAKEAWAY

Think of a car on a highway. The function f(t) is the car's position, f′(t) is its velocity (how fast it's moving), and f″(t) is its acceleration (how the velocity itself is changing). When f′ > 0, the car moves forward; when f″ > 0, the car is speeding up. A point where f″ changes sign is like the moment the driver switches from pressing the gas pedal to pressing the brake—the car is still moving, but the character of its motion has fundamentally changed. This triple-layered perspective—position, velocity, acceleration—is exactly the lens through which you should view every f−f′−f″ problem.

SECTION 3

Visual Explanation — f, f′, and f″ Aligned

The most effective way to internalize the connections among f, f′, and f″ is to see all three graphs stacked vertically with shared x-axes. The following diagram shows a polynomial function f along with its first and second derivatives, annotated with the key features: local extrema on f correspond to zeros of f′, and inflection points on f correspond to zeros (with sign changes) of f″. Study how each feature on one graph is mirrored by a specific behavior on the other two.

f, f′, and f″ for f(x) = x³ − 3xf(x) = x³ − 3xlocal maxlocal mininflectionxf′(x) = 3x² − 3f′=0f′=0min of f′xf′ > 0f′ < 0f′ > 0f″(x) = 6xf″=0f″ < 0 (concave down)f″ > 0 (concave up)x
Three aligned graphs for f(x) = x³ − 3x. The local maximum on f aligns with a zero of f′ where f′ changes from positive to negative. The inflection point on f occurs where f″ = 0 and changes sign, which also corresponds to a local extremum of f′.

Notice the cascading correspondence: where f has a local maximum, f′ crosses zero from above (positive to negative), and f″ is negative (confirming concave-down curvature). Where f has an inflection point, f′ has its own local extremum, and f″ crosses zero. These vertical alignments are not coincidences—they are direct consequences of differentiation, and recognizing them instantly is the skill the AP exam rewards.

SECTION 4

Mathematical Framework

The formal machinery underlying the connections among f, f′, and f″ rests on a few key theorems. Mastering the precise statements and conditions of these results is essential for justification on free-response questions, where citing the correct theorem by name and verifying its hypotheses earns full credit.

FIRST DERIVATIVE TEST FOR LOCAL EXTREMA

Iff′(c)=0orf′(c)DNE,andf′changessignatx=c,thenfhasalocalextremumatc.If f′(c) = 0 or f′(c) DNE, and f′ changes sign at x = c, then f has a local extremum at c.

f′ changes from + to − ⟹ local maximum at c. f′ changes from − to + ⟹ local minimum at c. If f′ does not change sign, then c is not a local extremum.

SECOND DERIVATIVE TEST FOR LOCAL EXTREMA

Iff′(c)=0andf″(c)exists,then:f″(c)>0⟹localmin;f″(c)<0⟹localmax.If f′(c) = 0 and f″(c) exists, then: f″(c) > 0 ⟹ local min; f″(c) < 0 ⟹ local max.

When f″(c) = 0, the test is inconclusive—you must revert to the First Derivative Test. This test is often faster when f″ is easy to compute, but it has this built-in limitation.

CONCAVITY AND INFLECTION

f″(x)>0on(a,b)⟹fisconcaveupon(a,b).f″(x)<0on(a,b)⟹fisconcavedownon(a,b).f″(x) > 0 on (a, b) ⟹ f is concave up on (a, b). f″(x) < 0 on (a, b) ⟹ f is concave down on (a, b).

An inflection point of f occurs at x = c when f″ changes sign at c. It is not sufficient that f″(c) = 0; the sign change is required. For instance, f(x) = x⁴ has f″(0) = 0 but no inflection point at 0 because f″ does not change sign.

INCREASING/DECREASING TEST

f′(x)>0forallxin(a,b)⟹fisstrictlyincreasingon[a,b].f′(x)<0forallxin(a,b)⟹fisstrictlydecreasingon[a,b].f′(x) > 0 for all x in (a, b) ⟹ f is strictly increasing on [a, b]. f′(x) < 0 for all x in (a, b) ⟹ f is strictly decreasing on [a, b].

Note the convention: the derivative is tested on the open interval, but the conclusion about monotonicity applies to the closed interval, provided f is continuous on [a, b] and differentiable on (a, b).

💡

AP Exam Tip

On free-response questions, the College Board requires justifications that explicitly reference the sign of f′ or f″, not just a vague appeal to the graph. Write statements like 'f has a local maximum at x = 2 because f′ changes from positive to negative at x = 2' or 'f is concave up on (1, 4) because f″(x) > 0 on that interval.' Named theorems and sign-change language earn the justification points.

SECTION 5

Sign Charts & Feature Correspondence

A sign chart (sometimes called a sign diagram) is the single most useful organizational tool for connecting f, f′, and f″. By partitioning the number line at the critical points of f′ and f″, and recording the sign of each derivative on every sub-interval, you can extract every qualitative feature of f—its intervals of increase and decrease, its local extrema, its intervals of concavity, and its inflection points—in a systematic, error-resistant way. The diagram below illustrates a complete sign-chart analysis for the function f(x) = 3x⁵ − 5x³.

Sign Chart for f(x) = 3x⁵ − 5x³f′(x) = 15x⁴ − 15x² = 15x²(x² − 1)Critical points: x = −1, 0, 1−101+−−+f increasingf decreasingf decreasingf increasingLOCAL MAXNO EXTREMUMLOCAL MINf″(x) = 60x³ − 30x = 30x(2x² − 1)Zeros: x = −1/√2, 0, 1/√2−1/√201/√2−+−+concave downconcave upconcave downconcave upINFLECTIONINFLECTIONINFLECTIONSummary: f has a local max at x = −1, a local min at x = 1, and inflection points at x = −1/√2, 0, 1/√2.Note: x = 0 is a critical point of f but NOT a local extremum because f′ does not change sign there (− to −).
Complete sign charts for f′ and f″ of f(x) = 3x⁵ − 5x³. The positive signs and negative signs on f′ determine where f is increasing or decreasing. The signs on f″ determine concavity. At x = 0, f′ = 0 but does not change sign, so there is no extremum—only an inflection point.
Feature of fWhat f′ tells youWhat f″ tells you
f is increasingf′ > 0—
f is decreasingf′ < 0—
f has a local max at cf′(c) = 0 and f′ changes + to −f″(c) < 0 (if it exists)
f has a local min at cf′(c) = 0 and f′ changes − to +f″(c) > 0 (if it exists)
f is concave upf′ is increasingf″ > 0
f is concave downf′ is decreasingf″ < 0
f has an inflection point at cf′ has a local extremum at cf″ changes sign at c

Complete correspondence table for f, f′, and f″

SECTION 6

Worked Example

Let us perform a complete analysis of f(x) = x⁴ − 4x³ + 4x², identifying all critical points, local extrema, intervals of increase/decrease, concavity intervals, and inflection points.

Full Analysis of f(x) = x⁴ − 4x³ + 4x²

  1. 1

    Step 1 — Find f′(x)

    Differentiate term by term: f′(x) = 4x³ − 12x² + 8x. Factor: f′(x) = 4x(x² − 3x + 2) = 4x(x − 1)(x − 2).
    f′(x) = 4x(x − 1)(x − 2)
  2. 2

    Step 2 — Identify Critical Points

    Set f′(x) = 0: 4x(x − 1)(x − 2) = 0 gives x = 0, x = 1, and x = 2. Since f′ is defined everywhere, these are the only critical points.
    Critical points: x = 0, 1, 2
  3. 3

    Step 3 — Sign Chart for f′

    Test values in each interval. For x < 0 (say x = −1): f′(−1) = 4(−1)(−2)(−3) = −24 < 0. For 0 < x < 1 (say x = 0.5): f′(0.5) = 4(0.5)(−0.5)(−1.5) = 1.5 > 0. For 1 < x < 2 (say x = 1.5): f′(1.5) = 4(1.5)(0.5)(−0.5) = −1.5 < 0. For x > 2 (say x = 3): f′(3) = 4(3)(2)(1) = 24 > 0.
    f′ sign pattern: − | + | − | + over (−∞,0), (0,1), (1,2), (2,∞)
  4. 4

    Step 4 — Classify Extrema Using the First Derivative Test

    At x = 0: f′ changes from − to +, so f has a local minimum. f(0) = 0. At x = 1: f′ changes from + to −, so f has a local maximum. f(1) = 1 − 4 + 4 = 1. At x = 2: f′ changes from − to +, so f has a local minimum. f(2) = 16 − 32 + 16 = 0.
    Local min at (0, 0) and (2, 0); Local max at (1, 1)
  5. 5

    Step 5 — Find f″(x) and Analyze Concavity

    f″(x) = 12x² − 24x + 8 = 4(3x² − 6x + 2). Set f″(x) = 0: 3x² − 6x + 2 = 0, so x = (6 ± √(36 − 24))/6 = (6 ± 2√3)/6 = 1 ± √3/3 ≈ 0.423 and 1.577. Test f″ in the three intervals: f″(0) = 8 > 0 (concave up), f″(1) = 12 − 24 + 8 = −4 < 0 (concave down), f″(2) = 48 − 48 + 8 = 8 > 0 (concave up).
    Inflection points at x = 1 ± √3/3. Concave up on (−∞, 1 − √3/3) ∪ (1 + √3/3, ∞); concave down on (1 − √3/3, 1 + √3/3).
  6. 6

    Step 6 — Verify with the Second Derivative Test

    As a check: f″(0) = 8 > 0 confirms local minimum at x = 0 ✓. f″(1) = −4 < 0 confirms local maximum at x = 1 ✓. f″(2) = 8 > 0 confirms local minimum at x = 2 ✓. The Second Derivative Test agrees with the First Derivative Test in every case.
    Both derivative tests confirm all classifications ✓

SECTION 7

First Derivative Test vs. Second Derivative Test

Students often wonder which test to use when classifying critical points. Both the First Derivative Test and the Second Derivative Test can identify local extrema, but they differ in applicability, computational cost, and reliability. The table below provides a side-by-side comparison to guide your strategic decisions on the exam.

CriterionFirst Derivative TestSecond Derivative Test
What you needSign of f′ on both sides of cValue of f″(c)
Works when f′(c) DNE?Yes—handles cusps and cornersNo—requires f′(c) = 0
Inconclusive caseNever—always classifies if f′ exists on both sidesWhen f″(c) = 0
Computational costRequires testing multiple valuesRequires computing f″ and evaluating at c
Also reveals intervals of increase/decrease?YesNo
Best when…f′ is already factored; you also need monotonicity infof″ is easy to compute; you only need the type of extremum

First Derivative Test vs. Second Derivative Test

⚡

STRATEGY TIP

Think of the First Derivative Test as a Swiss army knife and the Second Derivative Test as a laser pointer. The Swiss army knife handles every situation—cusps, undefined derivatives, even flat inflection points—but it requires more work (testing multiple values). The laser pointer is fast and precise when it works (just evaluate f″), but it goes dark exactly when f″(c) = 0. On the AP exam, many students default to the Second Derivative Test for speed, but you should always be ready to fall back to the First Derivative Test when the second derivative is zero or hard to compute.

SECTION 8

Connections to Advanced Topics

The f−f′−f″ framework is not merely a topic on the AP exam; it is the gateway to several deeper ideas in calculus and beyond. In AP Calculus BC, the same pattern of reasoning—connecting a function to its successive derivatives—reappears in Taylor series, where the coefficients of the polynomial approximation are determined by f, f′, f″, f‴, and so forth evaluated at the center. It also underlies the analysis of parametric and polar curves, where the second derivative d²y/dx² governs the concavity of curves defined by x(t) and y(t). Understanding the conceptual machinery now pays dividends throughout the rest of the course.

This Lesson's ConceptAdvanced Extension
f′(c) = 0 and sign analysis for local extremaHigher-order derivative test: if f′(c) = f″(c) = ··· = f⁽ⁿ⁻¹⁾(c) = 0 and f⁽ⁿ⁾(c) ≠ 0, then n even ⟹ extremum, n odd ⟹ inflection
f″ determines concavity of y = f(x)For parametric curves, d²y/dx² = [(dx/dt)(d²y/dt²) − (dy/dt)(d²x/dt²)] / (dx/dt)³ determines concavity in parametric analysis
Sign chart partitions the domain at zeros of f′ and f″In optimization, the bordered Hessian matrix generalizes the second derivative test to multivariable functions
f″ provides curvature information qualitativelyThe curvature formula κ = |f″| / (1 + (f′)²)^(3/2) quantifies curvature precisely

From this lesson to advanced calculus

For the AP Calculus BC exam specifically, expect the f−f′−f″ connection to appear not only in dedicated analytical questions but also embedded within broader problems involving the Fundamental Theorem of Calculus, particle motion, and accumulation functions. When a problem defines g(x) = ∫₀ˣ f(t) dt, you are immediately in this framework: g′(x) = f(x) and g″(x) = f′(x), so analyzing the graph of f is equivalent to analyzing the first derivative of g. Recognizing these structural parallels quickly is one of the most transferable skills in BC calculus.

SECTION 9

Practice Problems

Question 1: CONCEPTUAL

Suppose f is a twice-differentiable function and you know that f′(3) = 0 and f″(3) = 5. Which of the following must be true?
  • A. f has a local maximum at x = 3.
  • B. f has a local minimum at x = 3.
  • C. f has an inflection point at x = 3.
  • D. f is concave down at x = 3.
  • E. f is decreasing at x = 3.
Show answer (B)
By the Second Derivative Test, since f′(3) = 0 and f″(3) = 5 > 0, f has a local minimum at x = 3. (A) is wrong because f″(3) > 0 implies concave up, which corresponds to a local minimum, not a maximum. (C) is wrong because an inflection point requires a sign change in f″, not merely a critical point. (D) is wrong because f″(3) = 5 > 0 means f is concave up, not concave down. (E) is wrong because while f′(3) = 0 means f is momentarily stationary, the local minimum means f was decreasing just before x = 3 and increasing just after.

Question 2: BASIC CALCULATION

Let f(x) = x³ − 6x² + 9x + 2. Find all critical points of f and classify each as a local maximum, local minimum, or neither.
  • A. Local max at x = 1, local min at x = 3
  • B. Local min at x = 1, local max at x = 3
  • C. Local max at x = 3, inflection point at x = 1
  • D. Local max at x = 1, neither at x = 3
  • E. No local extrema exist
Show answer (A)
f′(x) = 3x² − 12x + 9 = 3(x² − 4x + 3) = 3(x − 1)(x − 3). Setting f′(x) = 0 gives critical points x = 1 and x = 3. Using the Second Derivative Test: f″(x) = 6x − 12, so f″(1) = 6 − 12 = −6 < 0 (local maximum at x = 1) and f″(3) = 18 − 12 = 6 > 0 (local minimum at x = 3). (B) reverses the classifications. (C) is wrong because x = 1 is a critical point of f, not an inflection point. (D) is wrong because f″(3) = 6 > 0 confirms a local minimum, not 'neither.' (E) is wrong because two sign changes in f′ are confirmed by factoring.

Question 3: INTERMEDIATE

The graph of f′, the derivative of a continuous function f, is shown to be a downward-opening parabola with x-intercepts at x = −2 and x = 4, and vertex at (1, 9). On which interval(s) is f concave down?
  • A. (−2, 4)
  • B. (1, ∞)
  • C. (−∞, 1)
  • D. (−∞, −2) ∪ (4, ∞)
  • E. (−2, 1)
Show answer (B)
f is concave down where f″ < 0, which is equivalent to where f′ is decreasing. Since the graph of f′ is a downward-opening parabola with vertex at x = 1, f′ is increasing on (−∞, 1) and decreasing on (1, ∞). Therefore f″ < 0 (and f is concave down) on (1, ∞). (A) describes where f′ > 0, which tells us where f is increasing, not where f is concave down. (C) describes where f′ is increasing, which means f is concave up. (D) describes where f′ < 0 (f is decreasing), which is a monotonicity conclusion, not a concavity conclusion. (E) confuses the interval where f is both increasing and concave up.

Question 4: APPLIED

5 pts
A particle moves along a straight line with position function s(t) = t⁴ − 8t³ + 18t² for t ≥ 0. (a) Find all times t at which the particle changes direction. (b) Find all times t at which the acceleration changes sign, and interpret each in the context of the particle's motion. (c) On what interval(s) is the particle slowing down?
Show answer
Point 1 (Finding velocity): v(t) = s′(t) = 4t³ − 24t² + 36t = 4t(t² − 6t + 9) = 4t(t − 3)². Critical values: t = 0 and t = 3. Point 2 (Direction changes): Analyze the sign of v(t). For t slightly greater than 0, v > 0. At t = 3, (t − 3)² ≥ 0 always, and 4t > 0 for t > 0, so v(t) > 0 for all t > 0. v(0) = 0 but v does not change sign at t = 0 (particle starts from rest) or t = 3 (v touches zero but stays non-negative). The particle never changes direction for t > 0. Point 3 (Acceleration): a(t) = v′(t) = 12t² − 48t + 36 = 12(t² − 4t + 3) = 12(t − 1)(t − 3). Setting a(t) = 0: t = 1 and t = 3. Sign analysis: a > 0 on (0, 1), a < 0 on (1, 3), a > 0 on (3, ∞). Acceleration changes sign at t = 1 (from positive to negative) and t = 3 (from negative to positive). At t = 1, the particle transitions from speeding up to experiencing deceleration; at t = 3, the particle resumes acceleration. Point 4 (Slowing down): The particle slows down when velocity and acceleration have opposite signs. Since v(t) > 0 for all t > 0, the particle slows down when a(t) < 0, which occurs on (1, 3). Point 5 (Interpretation and context): On (0, 1), the particle moves in the positive direction and speeds up (v > 0, a > 0). On (1, 3), the particle moves in the positive direction but slows down (v > 0, a < 0). On (3, ∞), the particle moves in the positive direction and speeds up again (v > 0, a > 0). The times t = 1 and t = 3 correspond to inflection points of s(t), where the concavity of the position graph changes.

Question 5: CRITICAL THINKING

4 pts
Let g be a function defined on (−∞, ∞) such that g′(x) = (x − 1)²(x − 4)exe^x for all x. (a) Determine all critical points of g and classify each as a local maximum, local minimum, or neither, with justification. (b) Determine all x-values at which g has an inflection point. You do not need to compute g″ explicitly; instead, use the relationship between the behavior of g′ and the concavity of g. (c) Explain why the Second Derivative Test is inconclusive at x = 1, and describe how the First Derivative Test resolves this ambiguity.
Show answer
Point 1 (Critical points): g′(x) = 0 when (x − 1)²(x − 4)exe^x = 0. Since exe^x > 0 for all x, the zeros come from (x − 1)²(x − 4) = 0, giving x = 1 and x = 4. Point 2 (Classification): Analyze the sign of g′. The factor (x − 1)² ≥ 0 always and exe^x > 0 always, so the sign of g′ depends solely on (x − 4). For x < 4 (and x ≠ 1): (x − 4) < 0, so g′(x) ≤ 0. For x > 4: (x − 4) > 0, so g′(x) > 0. At x = 1: g′ does not change sign (negative on both sides), so x = 1 is neither a local max nor a local min. At x = 4: g′ changes from negative to positive, so g has a local minimum at x = 4. Point 3 (Inflection points): g has an inflection point where g″ changes sign, which is equivalent to where g′ changes from increasing to decreasing or vice versa. Since g′(x) = (x − 1)²(x − 4)exe^x, we examine the behavior of g′: g′ has a local minimum at some point between 1 and 4 and a local maximum near x = 1 (since g′(1) = 0 and g′ is negative on either side, g′ increases toward 0 at x = 1 from the left and then decreases). The inflection points of g correspond to the local extrema of g′. By analyzing g′, the function g′ has local extrema at values that can be found from g″ = 0, but qualitatively, g′ is decreasing, then increasing, then decreasing, then increasing—yielding inflection points of g at each transition. Point 4 (SDT inconclusive at x = 1): The Second Derivative Test requires f′(c) = 0 and then evaluates f″(c). At x = 1, g′(1) = 0 so the critical point condition is met. However, since (x − 1)² contributes a double root, g″(1) = 0 as well (the derivative of g′ at x = 1 is zero because g′ touches zero without crossing). This makes the SDT inconclusive. The First Derivative Test resolves the ambiguity: g′ is negative for x < 1 and negative for 1 < x < 4, so g′ does not change sign at x = 1, confirming x = 1 is not a local extremum.

SUMMARY

Summary

Summary

The connections among f, f′, and f″ form a layered portrait of function behavior. The first derivative reveals intervals of increase and decrease and identifies critical points where local extrema may occur. The second derivative exposes concavity—whether the graph bends upward or downward—and pinpoints inflection points where curvature reverses.

The First Derivative Test classifies extrema by checking whether f′ changes sign—it works universally, even at cusps and corners. The Second Derivative Test offers a faster route when f″(c) ≠ 0 but is inconclusive when f″(c) = 0. Building a sign chart for f′ and f″ is the most reliable strategy for extracting every qualitative feature of f, and it is the backbone of justification on AP free-response questions. Always verify that zeros of f″ are genuine inflection points by confirming a sign change—not every zero of f″ is an inflection point.

Varsity Tutors • AP Calculus BC • Connecting a Function, Its First Derivative, and Its Second Derivative