Function analysis and optimisation

6 visual steps · 3 worked examples · 5 exercises with solutions

First, let’s see the idea.

With 20 m of fencing, which rectangle has the largest area?

Move forward one step at a time. Change the values and observe what happens.

The fence giving the most areaPerimeter: 20 m3 m × 7 m
Drawing description

The rectangle has sides of 3 m and 7 m; the fence totals 20 m.

Step 1 of 6

Divide the 20 metres

Change x and watch the plot widen as it becomes shorter.

Two sides measure x and the other two y. Dividing perimeter by 2 gives x+y=10; after choosing x, 10−x remains for y.

2x+2y=20; y=10−x
Sides
3 m × 7 m
Perimeter
20 m

What if you change this?

0 m10 m

Before moving on

Compare x=2 and x=8. Why is area equal?

Compare with the explanation

Both give 16 m². Swapping the sides keeps the same rectangle and product.

You decide when to mark this lesson as studied.

The fence giving the most area

Slide the drawing to see the details.

Explore the full explanationThe foundations, principles, worked examples and all the exercises, at your own pace.

What you will understand

  • Construct a justified variation analysis.
  • Compare critical points, interval endpoints and points without a derivative.
  • Translate a problem's constraints into a function and domain.

Before you start

You do not need to know everything by heart. The explanation revisits the necessary ideas and shows how they connect. If a foundation is still unclear, you can return to these lessons:

Questions come before derivatives

An isolated formula does not determine an optimisation problem. The expression A(x)=x(20−x), for example, can be studied over all real numbers as a polynomial; if x and 20−x are lengths, only 0<x<20 represents nondegenerate rectangles. The contextual domain may be smaller than the algebraic domain. We must also decide what to maximise: area, efficiency, revenue or another quantity.

Start by naming variables with units, drawing the configuration and writing the constraints. Then eliminate variables, where possible, to obtain a function of one input. An optimal answer requires existence and admissibility: a value that makes the derivative zero may lie outside the permitted interval or violate an original condition. The drawing organises relationships, but constraints must appear explicitly in equations and inequalities.

The function's sign and the derivative's sign

The sign of f(x) indicates whether the graph is above or below the horizontal axis. The sign of f′(x) describes variation: if f′ is positive on an interval, f is increasing there; if negative, f is decreasing. These are different questions. The function −10+x increases on (0,2), despite taking only negative values on that interval.

To construct a variation table, find where the derivative is zero or ceases to exist and split the domain at those points and its gaps. Determine the sign on each interval through factoring or another argument. A single test value works when we already know there are no zeros or changes of definition on the interval. Then translate signs into increasing and decreasing arrows and calculate outputs at relevant points.

Local extrema, absolute extrema and candidates

A local maximum exceeds sufficiently nearby outputs; an absolute maximum exceeds every output in the domain under consideration. A minimum follows the reverse comparison. If there is an extremum at an interior point where the derivative exists, it must be zero: a strictly positive or negative rate would allow greater values on one side and smaller ones on the other. This necessary condition is not sufficient.

Candidates include interior points where f′=0, interior points where the derivative does not exist and interval endpoints belonging to the domain. For a continuous function on a closed bounded interval [a,b], absolute maximum and minimum values exist. Compare the values of all these candidates. On open intervals, a limiting value may never be reached: f(x)=x on (0,1) approaches 1 but has no maximum. Distinguish a greatest existing value from an upper bound.

Justify an extremum and interpret curvature

If the derivative changes from positive to negative at a point, the function rises then falls: there is a local maximum. If it changes from negative to positive, there is a local minimum. If it keeps its sign, this criterion yields no extremum. For x³, the derivative 3x² is positive on both sides of zero, although it vanishes at that point.

The second derivative describes how the rate changes. Where f″>0, the derivative increases and the graph is concave upward; where f″<0, the reverse occurs. If f′(c)=0 and f″(c)>0, we have a local minimum; with f″(c)<0, a local maximum. When f″(c)=0, the test is inconclusive. Merely solving f″=0 does not establish an inflection point: a change in concavity must be confirmed and the point must belong to the graph.

An area model with a constraint

Imagine 48 m of fencing for a complete rectangle. If its sides are x and y, then 2x+2y=48, so y=24−x. The area is A=x(24−x), in m², with 0<x<24. The derivative A′=24−2x vanishes at x=12. It is positive before that value and negative afterwards. Therefore, the square of side 12 m reaches the greatest admissible area.

The verification can also be purely algebraic: A(x)=144−(x−12)². A square is always nonnegative, so A≤144, with equality only at x=12. This second solution confirms the conclusion and explains why balancing the sides improves the area. The derivative is a general tool, not an obligation when another structure solves the problem better. In geometric models, always seek this opportunity for independent verification.

Robust decisions and the model's limits

Mathematical optimisation depends on assumptions. If the fence includes a gate, if one side is already built or if only integer lengths are allowed, the constraint changes. A continuous optimum may serve as a reference, but a discrete choice requires comparing admissible neighbouring integers and any boundaries. Rounding without returning to the conditions may produce an impossible solution.

A complete answer presents the choice, optimal value, units and reason it is globally best. In applications, discuss sensitivity: near x=12, a change of 1 m in the first dimension, compensated in the other, reduces area by 1 m², since A(12+h)=144−h². Thus the model also informs the decision's tolerance. There is no need to calculate more decimal places than the data permit or to confuse numerical precision with physical accuracy.

Worked examples, without skipping steps

Follow the reasoning first. Then cover the solution and try to reconstruct it in your own words.

Example 1

Candidates on a closed interval

Find the absolute extrema of f(x)=x³−3x on [−2,3].

  1. The function is continuous on the closed interval; extrema exist. The derivative is 3x²−3=3(x−1)(x+1).
  2. The interior candidates are −1 and 1; add the endpoints −2 and 3.
  3. Calculate f(−2)=−2, f(−1)=2, f(1)=−2 and f(3)=18. Compare all outputs.
Result

Absolute minimum −2, reached at x=−2 and x=1; absolute maximum 18 at x=3.

Check the result

The point x=−1 is a local maximum, but its output 2 does not exceed the output 18 at the right endpoint.

Example 2

A rectangle with three fenced sides

There are 60 m to fence three sides of a rectangle; the fourth is a wall. Which dimensions maximise the area?

  1. If x is each side perpendicular to the wall and y the parallel side, 2x+y=60. Therefore y=60−2x and 0<x<30.
  2. The area is 60x−2x². The derivative 60−4x vanishes at x=15.
  3. The derivative is positive before 15 and negative afterwards; the maximum is global on the admissible domain.
Result

x=15 m, y=30 m and maximum area 450 m².

Check the result

2·15+30=60 confirms the constraint; 450−2(x−15)² confirms that no other input produces a greater area.

Example 3

A minimum without a derivative

Determine the extrema of f(x)=|x−1| on [−2,4].

  1. The function is continuous but not differentiable at 1. This point must enter the candidate list.
  2. To the left of 1 the slope is −1 and to the right it is 1; there is a minimum at 1.
  3. Compare f(−2)=3, f(1)=0 and f(4)=3.
Result

Minimum 0 at x=1 and maximum 3 at x=−2 and x=4.

Check the result

Solving only f′=0 would not find the minimum, because the derivative is never zero on either branch.

Now try it yourself

There is no timer. Write what you know, choose a relationship and justify each step. Hints and solutions are available whenever you need them.

Exercise 1

Study the variation of f(x)=x²−6x+5.
A hint
Factor the derivative and compare its sign relative to x=3.
See the worked solution
f′=2x−6 is negative for x<3 and positive for x>3. The function decreases until 3 and increases afterwards. The absolute minimum is f(3)=−4; there is no maximum over all real numbers.

Exercise 2

Does f(x)=x⁴ have a minimum at zero, even though f″(0)=0?
A hint
Use an argument that does not depend on the inconclusive test.
See the worked solution
Yes. x⁴≥0 for every x and equality occurs at zero. Also f′=4x³ changes from negative to positive. The second derivative test is inconclusive, not a denial of the extremum.

Exercise 3

Maximise x(10−x) when x can only be an integer from 1 to 4.
A hint
Respect the discrete domain.
See the worked solution
The continuous vertex would be x=5, outside the domain. At the permitted integers, the areas are 9,16,21,24; therefore the maximum is 24 at x=4. A zero derivative is not a condition for extrema on a discrete set.

Exercise 4

Does the function 1/x have a minimum on (1,5)?
A hint
Distinguish approaching the endpoint from including it.
See the worked solution
The derivative −1/x² is negative, so the function decreases. Outputs approach 1/5 as x→5 from the left, but 5 does not belong to the interval. The infimum is 1/5 and no attained minimum exists.

Exercise 5

Revenue is R(q)=30q−0,5q² for 0≤q≤20. What is the maximum?
A hint
Compare the stationary point with the permitted bounds.
See the worked solution
R′=30−q is positive throughout [0,20]. The stationary point q=30 lies outside the domain. The maximum occurs at the endpoint q=20, with R(20)=600−200=400 monetary units.

Mistakes worth avoiding

All extrema satisfy f′=0.
Interval endpoints and nondifferentiable points are also candidates.
A zero derivative guarantees an extremum.
The sign may stay the same on both sides, as in x³.
The greatest value found is automatically admissible.
Check the domain and every model constraint.

The essentials to take with you

  • Write the objective function and domain before differentiating.
  • Distinguish the function's sign from the rate's sign.
  • Compare all candidates on a closed interval.
  • Justify the global optimum and check the constraints.

If you still cannot explain one of these ideas, return to the corresponding section and work through an example again. Recognising the difficulty is part of studying.

References for further study

Text and examples prepared for this learning path. These sources help check the principles and continue studying:

The organisation by school year is a study proposal. Pedagogical review by teachers remains a stage of the project.