I am studying optimal control (for an introductory course) and we have to know the derivatives of quadratic forms.
Out teacher said that the following are true: $$\frac{\partial Ax}{\partial x} = A^T $$ $$ \frac{\partial x^TAx}{\partial x} = (A^T+A)x $$
from what i gathered (using this source: https://www.kamperh.com/notes/kamper_matrixcalculus13.pdf ) the derivative of a scalar function is defined as: $$\frac{\partial f(x)}{\partial x} = \begin{bmatrix} \frac{\partial f}{\partial x_1} \\ \frac{\partial f}{\partial x_2} \\ ... \\ \frac{\partial f}{\partial x_n} \end{bmatrix} $$
however, i have been taught the derivative so far as (also presented here http://michael.orlitzky.com/articles/the_derivative_of_a_quadratic_form.xhtml) : $$\frac{\partial f(x)}{\partial x} = \begin{bmatrix} \frac{\partial f}{\partial x_1}, \frac{\partial f}{\partial x_2}, ... , \frac{\partial f}{\partial x_n} \end{bmatrix} $$
This way of thinking about the derivative is combatible witht he taylor series: $$ f(x+h) = f(x) + \frac{\partial f(x)}{\partial x} \cdot h $$
And the previous derivatives now become (for combatible dimensions. See also the second link where the folling are prooved) : $$\frac{\partial Ax}{\partial x} = A $$ $$ \frac{\partial x^TAx}{\partial x} = x^T(A^T+A) $$
Is someone wrong? If that is not the case, what is the motivation (and advantages ?) for the second definition?
Your derivatives are just the transposes of what your teacher said. Both are correct; they just use different conventions of matrix differentiation. In general, you may find the wiki rules helpful, which give rules for both conventions.