Let

f(x) = x^2 if x ≤ 1
ax + b if x > 1.
Find the values of a and b so that f is continuous and has a derivative at x = 1.

Given the function

f(x)=x² x≤1
=ax+b x>2

For f(x) to be continuous at x=1, we need the following conditions:
1. f(1) exists and defined. Satisfied, f(1)=1.
2. Lim f(x) x->1- is defined and equal to f(1). Satisfied.
3. Lim f(x) x->1+ exists and equal to f(1). Depends on choice of a and b.

For f(x) to have a derivative at x=1, again we need the following conditions:
1. f'(1) exists and defined.
Satisfied, since f'(x)=2x, so f'(1)=2.
2. Lim f'(1) x->1- exists and equals f'(1). Satisfied.
3. Lim f'(1) x->1+ exists and equals f'(1) - to be satisfied by the proper choice of a and b.

Thus our choice of a and b are such that
slope=a=f'(1)=2
y=ax+b passes through (1,1).
so
(y-1)=2(x-1)
y=2x-1
which means a=2, b=-1.

See resulting function plotted graphically, curve applies to the left of x=1, and straight line applies to the right.

http://img163.imageshack.us/img163/3669/1296841563.png

To find the values of `a` and `b` such that function `f(x)` is continuous and has a derivative at `x = 1`, we need to ensure that the following conditions are satisfied:

1. The function `f(x)` is continuous at `x = 1`. This means that the limit of `f(x)` as `x` approaches 1 from both sides should be equal.

- Taking the limit as `x` approaches 1 from the left (x < 1):
`lim x→1- f(x) = lim x→1- x^2 = 1^2 = 1`

- Taking the limit as `x` approaches 1 from the right (x > 1):
`lim x→1+ f(x) = lim x→1+ (ax + b) = a(1) + b = a + b`

To ensure the function is continuous at `x = 1`, the limits from both sides must be equal. Therefore, we have:
`1 = a + b`

2. The function `f(x)` has a derivative at `x = 1`. This means that the derivatives of both parts of `f(x)` evaluated at `x = 1` should be equal.

- The derivative of `f(x)` when `x ≤ 1` is:
`f'(x) = d/dx (x^2) = 2x`

- The derivative of `f(x)` when `x > 1` is:
`f'(x) = d/dx (ax + b) = a`

To ensure the function has a derivative at `x = 1`, the derivatives from both parts must be equal. Therefore, we have:
`2(1) = a`

Solving the system of equations formed by the two conditions:

1 = a + b (from condition 1)
2 = a (from condition 2)

We can solve for `a` and `b`:

From condition 2, we have:
a = 2

Substituting `a` back into condition 1, we have:
1 = 2 + b

Solving for `b`, we get:
b = -1

Therefore, the values of `a` and `b` that make `f(x)` continuous and have a derivative at `x = 1` are `a = 2` and `b = -1`.