# Partial Derivatives

#### OhMyMarkov

##### Member
Hello Everyone!

This has been confusing me a lot: consider a function $f(x) = x^2 + 2x + 3$. Now, $\frac{\partial f}{\partial x} = 2x + 2$. Now, someone tells me that $y = x^2$. What is $\frac{\partial f}{\partial x}$ now?

#### Sudharaka

##### Well-known member
MHB Math Helper
Hello Everyone!

This has been confusing me a lot: consider a function $f(x) = x^2 + 2x + 3$. Now, $\frac{\partial f}{\partial x} = 2x + 2$. Now, someone tells me that $y = x^2$. What is $\frac{\partial f}{\partial x}$ now?
Hi OhMyMarkov,

What method did you use to differentiate $$f(x) = x^2 + 2x + 3$$ ?

#### CaptainBlack

##### Well-known member
Hello Everyone!

This has been confusing me a lot: consider a function $f(x) = x^2 + 2x + 3$. Now, $\frac{\partial f}{\partial x} = 2x + 2$. Now, someone tells me that $y = x^2$. What is $\frac{\partial f}{\partial x}$ now?
It would help if you used a consistent notation, and were more explicit with the question.

If you are asking: if $$f(x,y)=y+2x+3$$ what is $$\frac{\partial f}{\partial x}$$? Then the answer is:

$$\frac{\partial f}{\partial x}=2$$

but we are treating $$y$$ as a seperate variable from $$x$$, if it is a function of $$x$$ we have:

$$\frac{\partial f}{\partial x}=\frac{\partial y}{\partial x}+2=2x+2$$

CB

#### Sudharaka

##### Well-known member
MHB Math Helper
Hello Everyone!

This has been confusing me a lot: consider a function $f(x) = x^2 + 2x + 3$. Now, $\frac{\partial f}{\partial x} = 2x + 2$. Now, someone tells me that $y = x^2$. What is $\frac{\partial f}{\partial x}$ now?
Hi OhMyMarkov,

What method did you use to differentiate $$f(x) = x^2 + 2x + 3$$ ?
Hi OhMyMarkov,

I think CaptainBlack has given you a complete explanation about all you need to know.

Looking at your question what I thought was, you have differentiated $$f(x) = x^2 + 2x + 3$$ with respect to $$x$$ either by using the definition of the derivative or by using derivatives of elementary functions. So you want to find out how to differentiate $$y=x^2$$ using the same method.

Kind Regards,
Sudharaka.

#### HallsofIvy

##### Well-known member
MHB Math Helper
Hello Everyone!

This has been confusing me a lot: consider a function $f(x) = x^2 + 2x + 3$. Now, $\frac{\partial f}{\partial x} = 2x + 2$. Now, someone tells me that $y = x^2$. What is $\frac{\partial f}{\partial x}$ now?
Your notation isn't quite standard. If f(x) is a function of the single varable, x, then the derivative should be written $\frac{df}{dx}= 2x+ 2$, an "ordinary" derivative, not a partial derivative.

If, further, $y= x^2$ so that f(x,y)= y+ 2x+ 3, we have $\frac{\partial f}{\partial x}= 2$ and $\frac{\partial f}{\partial y}= 1$. But knowing that $y= x^2$, so that $\frac{dy}{dx}= 2x$, we can use the chain rule to regain $\frac{df}{dx}$$= \frac{\partial f}{\partial y}\frac{dy}{dx}+ \frac{\partial f}{\partial x}\frac{dx}{dx}$$= 1(2x)+ 2(1)= 2x+ 2$ as before.

#### OhMyMarkov

##### Member
I'm asking about this in relation to a problem of a more general scope, optimization. If we have more than one variable, x1, x2, ... xK, with a subtle relationship between the variables (kind of like how the expectation of an RV is related to the trace of a covariance matrix, for e.g.). When trying to find a minimum of a function, should we treat the problem as single-variable or multiple-variable.

#### CaptainBlack

##### Well-known member
I'm asking about this in relation to a problem of a more general scope, optimization. If we have more than one variable, x1, x2, ... xK, with a subtle relationship between the variables (kind of like how the expectation of an RV is related to the trace of a covariance matrix, for e.g.). When trying to find a minimum of a function, should we treat the problem as single-variable or multiple-variable.
Multi-variable constrained optimisation.

Unconstrained if you can use the side condition/s to eliminate one of the variable from the objective.

CB