Identification of convex and concave functions - Problems

 

Question

Show that the function

f(x)=exf(x) = e^{x}

is a convex function on R\mathbb{R}.


Solution

To show that f(x)=exf(x) = e^xis convex, we use the second derivative test for convexity.


Step 1: Compute the First Derivative

f(x)=ddx(ex)=exf'(x) = \frac{d}{dx}(e^x) = e^x

Step 2: Compute the Second Derivative

f(x)=d2dx2(ex)=exf''(x) = \frac{d^2}{dx^2}(e^x) = e^x

Step 3: Apply the Convexity Test

Since

f(x)=ex>0xR,f''(x) = e^x > 0 \quad \forall x \in \mathbb{R},

the second derivative is positive everywhere.


Conclusion

A function whose second derivative is non-negative on an interval is convex on that interval. Hence,

f(x)=ex is a convex function on R.\boxed{ f(x) = e^x \text{ is a convex function on } \mathbb{R}. }

(Optional) Remark for Deeper Understanding

The exponential function satisfies Jensen’s inequality:

eλx1+(1λ)x2λex1+(1λ)ex2,λ[0,1],e^{\lambda x_1 + (1-\lambda)x_2} \le \lambda e^{x_1} + (1-\lambda)e^{x_2}, \quad \lambda \in [0,1],

which further confirms its convexity.

Question

Determine whether the function

g(x)=x2g(x) = -x^2

is convex or concave.


Solution

To determine whether g(x)=x2g(x) = -x^2is convex or concave, we use the second derivative test.


Step 1: Compute the First Derivative

g(x)=ddx(x2)=2xg'(x) = \frac{d}{dx}(-x^2) = -2x

Step 2: Compute the Second Derivative

g(x)=d2dx2(x2)=2g''(x) = \frac{d^2}{dx^2}(-x^2) = -2

Step 3: Apply the Concavity/Convexity Test

Since

g(x)=2<0xR,g''(x) = -2 < 0 \quad \forall x \in \mathbb{R},

the second derivative is negative everywhere.


Conclusion

A function whose second derivative is non-positive on an interval is concave on that interval.

g(x)=x2 is a concave function on R.\boxed{ g(x) = -x^2 \text{ is a concave function on } \mathbb{R}. }

Additional Remark 

The graph of g(x)=x2g(x) = -x^2

 is an inverted parabola, which visually confirms that the function bends downward, a characteristic of concave functions.

Question

Minimize the function

f(x)=x2+4x+6.f(x) = x^2 + 4x + 6.


Solution

We minimize the given function using calculus.


Step 1: Compute the First Derivative

f(x)=ddx(x2+4x+6)=2x+4f'(x) = \frac{d}{dx}(x^2 + 4x + 6) = 2x + 4


Step 2: Find the Critical Point

Set the first derivative equal to zero:

2x+4=0x=22x + 4 = 0 \quad \Rightarrow \quad x = -2


Step 3: Verify Minimum Using Second Derivative

f(x)=d2dx2(x2+4x+6)=2>0f''(x) = \frac{d^2}{dx^2}(x^2 + 4x + 6) = 2 > 0

Since the second derivative is positive, the function is convex, and the critical point corresponds to a minimum.


Step 4: Compute the Minimum Value

f(2)=(2)2+4(2)+6=48+6=2f(-2) = (-2)^2 + 4(-2) + 6 = 4 - 8 + 6 = 2


Final Answer

The minimum value of f(x) is 2 attained at x=2.\boxed{ \text{The minimum value of } f(x) \text{ is } 2 \text{ attained at } x = -2. }

Question

Prove that the function

f(x)=x2f(x) = x^2

is a convex function using the definition of convexity.


Solution

Step 1: Recall the Definition of Convexity

A function f:RRf:\mathbb{R} \to \mathbb{R} is convex if for all x1,x2Rx_1, x_2 \in \mathbb{R} and for all λ[0,1]\lambda \in [0,1],

f(λx1+(1λ)x2)    λf(x1)+(1λ)f(x2).f(\lambda x_1 + (1-\lambda)x_2) \;\le\; \lambda f(x_1) + (1-\lambda)f(x_2).


Step 2: Evaluate the Left-Hand Side

f(λx1+(1λ)x2)=(λx1+(1λ)x2)2=λ2x12+(1λ)2x22+2λ(1λ)x1x2.\begin{aligned} f(\lambda x_1 + (1-\lambda)x_2) &= (\lambda x_1 + (1-\lambda)x_2)^2 \\ &= \lambda^2 x_1^2 + (1-\lambda)^2 x_2^2 + 2\lambda(1-\lambda)x_1x_2. \end{aligned}


Step 3: Evaluate the Right-Hand Side

λf(x1)+(1λ)f(x2)=λx12+(1λ)x22.\lambda f(x_1) + (1-\lambda)f(x_2) = \lambda x_1^2 + (1-\lambda)x_2^2.


Step 4: Compare Both Sides

Subtract the left-hand side from the right-hand side:

λx12+(1λ)x22(λx1+(1λ)x2)2=λ(1λ)(x1x2)2.\begin{aligned} &\lambda x_1^2 + (1-\lambda)x_2^2 - (\lambda x_1 + (1-\lambda)x_2)^2 \\ &= \lambda(1-\lambda)(x_1 - x_2)^2. \end{aligned}

Since

λ(1λ)0and(x1x2)20,\lambda(1-\lambda) \ge 0 \quad \text{and} \quad (x_1 - x_2)^2 \ge 0,

we have

λ(1λ)(x1x2)20.\lambda(1-\lambda)(x_1 - x_2)^2 \ge 0.

Thus,

f(λx1+(1λ)x2)λf(x1)+(1λ)f(x2).f(\lambda x_1 + (1-\lambda)x_2) \le \lambda f(x_1) + (1-\lambda)f(x_2).


Conclusion

The inequality in the definition of convexity holds for all
x1,x2Rx_1, x_2 \in \mathbb{R} and all λ[0,1].

Question

Determine whether the function

f(x)=x4f(x) = x^4

is convex or concave.


Solution

To determine whether the function is convex or concave, we apply the second derivative test.


Step 1: Compute the First Derivative

f(x)=ddx(x4)=4x3f'(x) = \frac{d}{dx}(x^4) = 4x^3

Step 2: Compute the Second Derivative

f(x)=d2dx2(x4)=12x2f''(x) = \frac{d^2}{dx^2}(x^4) = 12x^2

Step 3: Apply the Convexity/Concavity Test

Since

f(x)=12x20xR,f''(x) = 12x^2 \ge 0 \quad \forall x \in \mathbb{R},

the second derivative is non-negative everywhere.


Conclusion

A function whose second derivative is non-negative on an interval is convex on that interval.

f(x)=x4 is a convex function on R.\boxed{ f(x) = x^4 \text{ is a convex function on } \mathbb{R}. }

Question

Identify whether the function

f(x)=log(x)f(x) = \log(x)

is convex or concave.


Solution

To determine whether the function f(x)=log(x)f(x) = \log(x) is convex or concave, we use the second derivative test.


Step 1: State the Domain

The logarithmic function is defined only for

x>0.x > 0.

Step 2: Compute the First Derivative

f(x)=ddx(logx)=1xf'(x) = \frac{d}{dx}(\log x) = \frac{1}{x}

Step 3: Compute the Second Derivative

f(x)=d2dx2(logx)=1x2f''(x) = \frac{d^2}{dx^2}(\log x) = -\frac{1}{x^2}

Step 4: Apply the Convexity/Concavity Test

For all x>0x > 0,

f(x)=1x2<0.f''(x) = -\frac{1}{x^2} < 0.

Hence, the second derivative is negative everywhere on its domain.


Conclusion

A function whose second derivative is non-positive on an interval is concave on that interval.

f(x)=log(x) is a concave function on (0,).\boxed{ f(x) = \log(x) \text{ is a concave function on } (0,\infty). }

Additional Remark (Optional for Students)

  • Since log(x)\log(x) is concave, the inequality

    log(λx1+(1λ)x2)λlog(x1)+(1λ)log(x2)\log(\lambda x_1 + (1-\lambda)x_2) \ge \lambda \log(x_1) + (1-\lambda)\log(x_2)

    holds for all x1,x2>0 and λ[0,1]\lambda \in [0,1].

Question

For the function

f(x)=x24x+4,f(x) = x^2 - 4x + 4,

(i) find its minimum, and (ii) determine whether it is convex or concave.


Solution

Part (i): Finding the Minimum

Step 1: Compute the First Derivative

f(x)=ddx(x24x+4)=2x4f'(x) = \frac{d}{dx}(x^2 - 4x + 4) = 2x - 4

Step 2: Find the Critical Point

Set the first derivative equal to zero:

2x4=0x=22x - 4 = 0 \quad \Rightarrow \quad x = 2

Step 3: Compute the Minimum Value

f(2)=(2)24(2)+4=48+4=0f(2) = (2)^2 - 4(2) + 4 = 4 - 8 + 4 = 0

Thus, the minimum value of f(x)f(x) is 0, attained at x=2x = 2.


Part (ii): Checking Convexity or Concavity

Step 1: Compute the Second Derivative

f(x)=d2dx2(x24x+4)=2f''(x) = \frac{d^2}{dx^2}(x^2 - 4x + 4) = 2

Step 2: Apply the Convexity Test

Since

f(x)=2>0xR,f''(x) = 2 > 0 \quad \forall x \in \mathbb{R},

the second derivative is positive everywhere.


Conclusion

Minimum value of f(x)=0 at x=2,f(x)=x24x+4 is a convex function on R.\boxed{ \begin{aligned} &\text{Minimum value of } f(x) = 0 \text{ at } x = 2, \\ &f(x) = x^2 - 4x + 4 \text{ is a convex function on } \mathbb{R}. \end{aligned} }

Question

Find the critical points and determine the nature (local maximum, local minimum, or neither) of the function

f(x)=x3+3x29x+1.f(x) = x^3 + 3x^2 - 9x + 1.

Solution

Step 1: Compute the First Derivative

f(x)=ddx(x3+3x29x+1)=3x2+6x9f'(x) = \frac{d}{dx}(x^3 + 3x^2 - 9x + 1) = 3x^2 + 6x - 9

Step 2: Find the Critical Points

Critical points occur where f(x)=0

3x2+6x9=03x^2 + 6x - 9 = 0

Divide throughout by 3:

x2+2x3=0x^2 + 2x - 3 = 0

Factor:

(x+3)(x1)=0(x + 3)(x - 1) = 0

Hence,

x=3andx=1.x = -3 \quad \text{and} \quad x = 1.

Step 3: Compute the Second Derivative

f(x)=d2dx2(x3+3x29x+1)=6x+6f''(x) = \frac{d^2}{dx^2}(x^3 + 3x^2 - 9x + 1) = 6x + 6

Step 4: Determine the Nature of Each Critical Point

At x=3x = -3

f(3)=6(3)+6=12<0f''(-3) = 6(-3) + 6 = -12 < 0

So, f(x)f(x) has a local maximum at x=3


At x=1x = 1

f(1)=6(1)+6=12>0f''(1) = 6(1) + 6 = 12 > 0

So, f(x)f(x) has a local minimum at x=1x = 1


Step 5: (Optional) Compute Function Values

f(3)=(3)3+3(3)29(3)+1=27+27+27+1=28f(-3) = (-3)^3 + 3(-3)^2 - 9(-3) + 1 = -27 + 27 + 27 + 1 = 28
f(1)=(1)3+3(1)29(1)+1=1+39+1=4f(1) = (1)^3 + 3(1)^2 - 9(1) + 1 = 1 + 3 - 9 + 1 = -4

Conclusion

Critical points: x=3,  x=1Local maximum at x=3Local minimum at x=1\boxed{ \begin{aligned} &\text{Critical points: } x = -3,\; x = 1 \\ &\text{Local maximum at } x = -3 \\ &\text{Local minimum at } x = 1 \end{aligned} }

Question

Check whether the function

f(x,y)=x2+y2f(x,y) = x^2 + y^2

is convex and justify your answer.


Solution

We will use the second derivative (Hessian) test for convexity of multivariable functions.


Step 1: Compute the First-Order Partial Derivatives

fx=2x,fy=2y\frac{\partial f}{\partial x} = 2x, \qquad \frac{\partial f}{\partial y} = 2y

Step 2: Compute the Second-Order Partial Derivatives

2fx2=2,2fy2=2,2fxy=0\frac{\partial^2 f}{\partial x^2} = 2, \quad \frac{\partial^2 f}{\partial y^2} = 2, \quad \frac{\partial^2 f}{\partial x \partial y} = 0

Step 3: Form the Hessian Matrix

2f(x,y)=[2002]\nabla^2 f(x,y) = \begin{bmatrix} 2 & 0 \\ 0 & 2 \end{bmatrix}

Step 4: Check Positive Semidefiniteness

For convexity, the Hessian must be positive semidefinite.

  • Eigenvalues of the Hessian are 22 and 22

  • Both eigenvalues are positive

Hence, the Hessian is positive definite.


Step 5: Conclusion

Since the Hessian matrix is positive definite for all (x,y)R2(x,y) \in \mathbb{R}^2,

f(x,y)=x2+y2 is a convex function on R2.\boxed{ f(x,y) = x^2 + y^2 \text{ is a convex function on } \mathbb{R}^2. }

Geometric Interpretation (Optional)

  • The graph of f(x,y)=x2+y2f(x,y) = x^2 + y^2 is a paraboloid opening upward

  • The function has a unique global minimum at (0,0)(0,0)

Comments

Popular posts from this blog

Advanced Mathematics for Computer Science HNCST409 KTU BTech Honors 2024 Scheme

AKS Primality Testing

Galois Field and Operations