What are the first-order and second-order conditions for a twice-differentiable function f:Rd→R to be convex, and how do you prove that the second-order condition (∇2f(x)⪰0 everywhere) implies the first-order condition (f(y)≥f(x)+∇f(x)⊤(y−x))?

Linear algebra and optimisation, Convexity
Level L3 Intermediate. Length Medium. Nature Mat Mathematical.

What's being asked

Whether you can connect the tangent-plane lower bound (first-order) to curvature (second-order) via a 1-D slice and Taylor's theorem.

Key idea

Restrict f along the line segment from x to y by defining g(t)=f(x+t(y−x)) for t∈[0,1]. The chain rule turns the multivariate gradient and Hessian into scalar derivatives g′(t) and g′′(t), and Taylor's theorem with second-order remainder finishes the proof.

Steps

  1. State the first-order condition: a differentiable function f on Rd is convex iff f(y)≥f(x)+∇f(x)⊤(y−x) for all x,y∈Rd (the graph always lies on or above every tangent hyperplane).
  2. State the second-order condition: a twice-differentiable function f on Rd is convex iff its Hessian is positive semidefinite everywhere, ∇2f(z)⪰0 for all z∈Rd.
  3. Reduce to 1-D: fix any x,y∈Rd, let v=y−x, and define g(t)=f(x+tv) for t∈[0,1]. By the chain rule, g′(t)=∇f(x+tv)⊤v and g′′(t)=v⊤∇2f(x+tv) v.
  4. Apply Taylor's theorem at t=1: there exists an intermediate scalar ξ∈(0,1) such that g(1)=g(0)+g′(0)+12g′′(ξ), which reads f(y)=f(x)+∇f(x)⊤(y−x)+12(y−x)⊤∇2f(x+ξ(y−x)) (y−x).
  5. Conclude: since ∇2f(z)⪰0 everywhere, the quadratic remainder term is ≥0, so f(y)≥f(x)+∇f(x)⊤(y−x).

Common mistakes

How long your answer should be

Half a page; 4 minutes.

Last checked on 4 December 2026.

Read this

Previous in Linear algebra and optimisation: Why are the non-negative weighted sum ∑iαifi(x) (αi≥0), the pointwise maximum max⁡ifi(x), and the affine composition f(Ax+b) convex whenever each fi and f is convex, and how do these rules show that the L2-regularised hinge loss is convex without computing any Hessian?
Next in Linear algebra and optimisation: What is the Armijo (sufficient decrease) condition in backtracking line search, why is simply requiring f(x+αd)<f(x) not enough to guarantee convergence, and what step size does backtracking choose on f(x)=x2 from x0=2 in direction d=−4 with initial α0=1, shrink factor β=0.5 and c1=0.25?