← Back to course

Math — Mechina

"Give an example" questions: building a function from conditions

Summary

Every placement test has several "give an example of a function that…" questions. There is no "single answer" — any function that meets all the conditions is right. But only what is written in the frame is checked, so you must test every condition before writing.

  • 1. Pick a simple family: a line ax+bax+b, a parabola a(x−p)2+qa(x-p)^2+q, (x−a)(x−b)(x-a)(x-b), exe^{x}, 1x−a\frac1{x-a}, …\sqrt{\ldots}.
  • 2. Turn the conditions into equations: "f(2)=3f(2)=3" ⇒\Rightarrow substitution; "increasing on (a,b)(a,b)" ⇒f′>0\Rightarrow f'>0 there; "a maximum at x0x_0" ⇒f′(x0)=0\Rightarrow f'(x_0)=0 and a sign change.
  • 3. Check every condition — including the domain and "for every xx".
  • Increasing on (a,b)(a,b) and decreasing on (b,c)(b,c): f′=(b−x)f'=(b-x) ⇒\Rightarrow f=−(x−b)22f=-\frac{(x-b)^2}2. A parabola with its vertex at bb.
  • f<gf<g but f′>g′f'>g': g=f+hg=f+h with h>0h>0 decreasing, e.g. f=0f=0, g=e−xg=e^{-x}.
  • A 00\frac00 limit with a given value: f=L(x−a)f=L(x-a), g=x−ag=x-a ⇒fg→L\Rightarrow\frac fg\to L.
  • Even with a local maximum at x0≠0x_0\neq0: −(x2−x02)2-(x^2-x_0^2)^2 — maxima at ±x0\pm x_0.
  • A derivative and a value at a point: f(a)=cf(a)=c, f′(a)=mf'(a)=m ⇒\Rightarrow the tangent f=c+m(x−a)f=c+m(x-a). Need f′′f'' too? Add k2(x−a)2\frac k2(x-a)^2.
  • Two different functions with the same property: change one parameter (f=xf=x and f=2xf=2x), and check they really differ.
-3-2-1123456-9-8-7-6-5-4-3-2-11xy−(x−1)²/2(1, 0)x=−2x=5
Increasing on (−2,1)(-2,1) and decreasing on (1,5)(1,5): a downward parabola with its vertex at x=1x=1.

Question types

1

Values and derivatives at points

Values of ff, f′f' or f′′f'' are given at several points.

Worked example

Give an example of a function with f(1)=2f(1)=2, f′(1)=0f'(1)=0, f′′(1)=−4f''(1)=-4.

Solution

IdeaA parabola around x=1x=1: f=a(x−1)2+b(x−1)+cf=a(x-1)^2+b(x-1)+c, one coefficient per condition.
  1. f(1)=c=2f(1)=c=2.

    Why: Substitution.

  2. f′(x)=2a(x−1)+bf'(x)=2a(x-1)+b, so f′(1)=b=0f'(1)=b=0.

    Why: Differentiate.

  3. f′′=2a=−4⇒a=−2f''=2a=-4\Rightarrow a=-2.

    Why: The second derivative.

  4. f(x)=−2(x−1)2+2f(x)=-2(x-1)^2+2.
Checkf(1)=2f(1)=2, f′(1)=0f'(1)=0, f′′=−4f''=-4 ✓.
Common mistakef=−2x2+2f=-2x^2+2 — the parabola is around 00, and then f(1)=0f(1)=0.

Variants of this type · 1

1.1Two values and a derivative

Worked example

f(0)=1f(0)=1, f(2)=1f(2)=1, f′(0)=3f'(0)=3.

Solution

Ideaf=ax2+bx+1f=ax^2+bx+1.
  1. b=3b=3.
  2. 4a+6+1=1⇒a=−324a+6+1=1\Rightarrow a=-\frac32.
  3. f=−32x2+3x+1f=-\frac32x^2+3x+1.
Checkf(2)=−6+6+1=1f(2)=-6+6+1=1 ✓.
Common mistakeA line cannot meet three conditions.
2

Monotonicity, extrema and parity

"Increasing on … and decreasing on …", "a local maximum at …", "even and not constant".

Worked example

An example of an even, non-constant function with a local maximum at x=3x=3.

Solution

IdeaEven ⇒\Rightarrow also a maximum at −3-3. A function of x2x^2 that is largest when x2=9x^2=9.
  1. f(x)=−(x2−9)2f(x)=-(x^2-9)^2.

    Why: A function of x2x^2 — even.

  2. f≤0f\le0 and f(±3)=0f(\pm3)=0 — a maximum.

    Why: The largest value.

  3. Not constant: f(0)=−81f(0)=-81.
Checkf′=−4x(x2−9)f'=-4x(x^2-9): at x=3x=3 it goes from ++ to −- ✓.
Common mistake−(x−3)2-(x-3)^2 — not even.

Variants of this type · 2

2.1Increasing, then decreasing

Worked example

Increasing on (−2,1)(-2,1) and decreasing on (1,5)(1,5).

Solution

IdeaThe vertex at 11.
  1. f=−(x−1)2f=-(x-1)^2.
Checkf′=−2(x−1)f'=-2(x-1): positive for x<1x<1 ✓.
Common mistake(x−1)2(x-1)^2 — the other way round.
2.2f<gf<g and f′>g′f'>g'

Worked example

f(x)<g(x)f(x)<g(x) and f′(x)>g′(x)f'(x)>g'(x) for every real xx.

Solution

Ideag−fg-f is positive and decreasing.
  1. f=0f=0, g=e−xg=e^{-x}.
Check0<e−x0<e^{-x} and 0>−e−x0>-e^{-x} ✓.
Common mistakeg=1xg=\frac1x — undefined at 00.
3

Limits and domains to order

A pair of functions with given limits, or a function with a given domain/range.

Worked example

An example of ff, gg with lim⁡x→1f=0\lim_{x\to1}f=0, lim⁡x→1g=0\lim_{x\to1}g=0, lim⁡x→1fg=2\lim_{x\to1}\frac fg=2.

Solution

IdeaBoth vanish at 11, and their ratio is constant.
  1. g(x)=x−1g(x)=x-1.

    Why: Zero at 11.

  2. f(x)=2(x−1)f(x)=2(x-1).

    Why: 22 times gg.

  3. fg=2\frac fg=2 for every x≠1x\neq1.
CheckBoth limits are 00, the ratio is 22 ✓.
Common mistakef=2f=2, g=1g=1 — the limits are not zero.

Variants of this type · 1

3.1A given range

Worked example

A function on R\mathbb R whose range is (0,1](0,1].

Solution

IdeaPositive, maximum 11, approaching 00.
  1. f=11+x2f=\frac1{1+x^2}.
Checkf(0)=1f(0)=1, f→0f\to0, f>0f>0 ✓.
Common mistakee−xe^{-x} — its range is (0,∞)(0,\infty).

Practice · 20

Test yourself with problems and full solutions.

Go to practice