Example 4: Given [tex]$G(x)=\left\{\begin{array}{ll}x^2+2, & x \leq 1 \\ |x-3|, & x \ \textgreater \ 1 \end{array}\right.$], evaluate the following:

(a) [tex]$f(-5)$[/tex]

(b) [tex][tex]$f(5)$[/tex][/tex]

(c) [tex]$f(1)$[/tex]



Answer :

To evaluate the function [tex]\( G(x) \)[/tex] given by

[tex]\[ G(x) = \begin{cases} x^2 + 2, & \text{if } x \leq 1 \\ |x - 3|, & \text{if } x > 1 \end{cases} \][/tex]

we need to consider the given values of [tex]\( x \)[/tex] and determine which part of the piecewise function to use.

### (a) Evaluating [tex]\( G(-5) \)[/tex]

For [tex]\( x = -5 \)[/tex]:
- Since [tex]\(-5 \leq 1\)[/tex], we use the first part of the function: [tex]\( G(x) = x^2 + 2 \)[/tex].

Now, substitute [tex]\( x = -5 \)[/tex] into [tex]\( x^2 + 2 \)[/tex]:

[tex]\[ G(-5) = (-5)^2 + 2 = 25 + 2 = 27 \][/tex]

So, [tex]\( G(-5) = 27 \)[/tex].

### (b) Evaluating [tex]\( G(5) \)[/tex]

For [tex]\( x = 5 \)[/tex]:
- Since [tex]\( 5 > 1 \)[/tex], we use the second part of the function: [tex]\( G(x) = |x - 3| \)[/tex].

Now, substitute [tex]\( x = 5 \)[/tex] into [tex]\( |x - 3| \)[/tex]:

[tex]\[ G(5) = |5 - 3| = |2| = 2 \][/tex]

So, [tex]\( G(5) = 2 \)[/tex].

### (c) Evaluating [tex]\( G(1) \)[/tex]

For [tex]\( x = 1 \)[/tex]:
- Since [tex]\( 1 \leq 1 \)[/tex], we use the first part of the function: [tex]\( G(x) = x^2 + 2 \)[/tex].

Now, substitute [tex]\( x = 1 \)[/tex] into [tex]\( x^2 + 2 \)[/tex]:

[tex]\[ G(1) = 1^2 + 2 = 1 + 2 = 3 \][/tex]

So, [tex]\( G(1) = 3 \)[/tex].

In conclusion:
- [tex]\( G(-5) = 27 \)[/tex]
- [tex]\( G(5) = 2 \)[/tex]
- [tex]\( G(1) = 3 \)[/tex]