(100 – 2Px + 1Py) (Px -20)

Now, take the derivative of the above with respect to Px to get the following first order condition :
100- 4 Px + Py +40 = 0

When i try to multiply and then take the derivative of the top part out I keep getting : -1860-4Px-19Py

What am I doing wrong??

To take the derivative of the expression (100 – 2Px + 1Py) (Px - 20) with respect to Px, you need to use the product rule.

The product rule states that if you have two functions u(x) and v(x), then the derivative of their product is given by: d/dx (u(x) v(x)) = u'(x) v(x) + u(x) v'(x).

In this case, let u(x) = (100 – 2Px + 1Py) and v(x) = (Px - 20).

Now, let's take the derivative:

1. Find the derivative of u(x):
- Partial derivative of u(x) with respect to Px: -2
- Partial derivative of u(x) with respect to Py: 1

2. Find the derivative of v(x):
- Partial derivative of v(x) with respect to Px: 1

Using the product rule, the derivative of (100 – 2Px + 1Py) (Px - 20) with respect to Px is:

u'(x) v(x) + u(x) v'(x) = (-2) (Px - 20) + (100 – 2Px + 1Py) (1)

Simplifying, we get:

-2Px + 40 + 100 – 2Px + 1Py = 140 – 4Px + 1Py

Therefore, the correct derivative is 140 – 4Px + 1Py.

If you are getting a different result (-1860 - 4Px - 19Py), it seems there might be some calculation mistakes or the original expression was not correctly multiplied out. Please double-check your calculations and ensure that the expression was expanded correctly before taking the derivative.