Differentiate the following using the first principle

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

1. Using first principles:

f(x) = 2x

f'(x) = lim h->0 [(2(x+h) - 2x) / h]
= lim h->0 [2h / h]
= lim h->0 2
= 2

Therefore, f'(x) = 2

2. Using first principles:

f(x) = x^2 - 2x

f'(x) = lim h->0 [((x+h)^2 - 2(x+h) - (x^2 - 2x)) / h]
= lim h->0 [((x^2 + 2xh + h^2) - 2x - 2h - x^2 + 2x) / h]
= lim h->0 [(2xh + h^2 - 2h) / h]
= lim h->0 [h(2x + h - 2) / h]
= lim h->0 (2x + h - 2)
= 2x - 2

Therefore, f'(x) = 2x - 2