Why is d(x^TCx) equal to x^T(C+C^T)dx?

In summary, deriving quadratic products can be difficult to understand, but it can be done using the product rule.
  • #1
hotvette
Homework Helper
1,010
11
Referring to:

http://www.ee.ic.ac.uk/hp/staff/dmb/matrix/calculus.html#deriv_quad

Is there an easy way to illustrate why the following is true?

[tex]d(x^TCx) = x^T(C+C^T)dx[/tex]

My attempt at using the product rule doesn't seem to work:

[tex]A = x^TC[/tex]

[tex]B = x[/tex]

[tex]d(AB) = (dA)B + A(dB) = d(x^TC)x + x^TC[/tex]
 
Last edited:
Physics news on Phys.org
  • #2
hotvette said:
Referring to:

http://www.ee.ic.ac.uk/hp/staff/dmb/matrix/calculus.html#deriv_quad

Is there an easy way to illustrate why the following is true?

[tex]d(x^TCx) = x^T(C+C^T)dx[/tex]

My attempt at using the product rule doesn't seem to work:

[tex]A = x^TC[/tex]

[tex]B = x[/tex]

[tex]d(AB) = (dA)B + A(dB) = d(x^TC)x + x^TC[/tex]

From your link:

[tex]d(X^TCX): = (X^TCdX): + (d(X^T) CX): = (I ¤ X^TC) dX: + (X^TC^T ¤ I) dX^T:[/tex]

Anyway, it looks like they did exactly what you did, except that they didn't set dx to the identity matrix. You are assuming differentiation by dx. This might not be the case. Also notice that (d(X^T) CX) is scaler and thus invariant to the transpose operator. They multiplied this scaler by the identity matrix so adding the two matrices make sense. Anyway, nice link. It is a good reference.
 
Last edited:
  • #3
I was just trying to understand why the 2nd item under the heading "Differential of Quadratic Products":

[tex]d(x^TCx) = x^T(C+C^T)dx = [C=C^T]2x^TCdx[/tex]

is true. Is there any way to illustrate?

Assuming the standard product rule is valid, it means:

[tex]d/dx(x^TCx) = x^TC + (d/dx(x^T))Cx = x^TC + x^TC^T=x^T(C+C^T)[/tex]

What I don't understand is why:

[tex](d/dx(x^T))Cx = x^TC^T[/tex]
 
  • #4
[tex]d(x^TCx)=d(x^TC^Tx)[/tex]

[tex]x^TCdx + (dx)^TCx = x^TC^Tdx + (dx)^TC^Tx[/tex]

Since they are scalars

[tex]x^TCdx + \left((dx)^TCx\right)^T = x^TC^Tdx + \left((dx)^TC^Tx\right)^T[/tex]

[tex]x^TCdx + \left(x^TC^Tdx\right) = x^TC^Tdx + \left(x^TCdx\right)[/tex]

[tex]x^T\left(C+C^T\right)dx = x^T\left(C^T+C\right)dx[/tex]

If [tex]C[/tex] is symmetric then that equals [tex]2x^TCdx[/tex]
 
  • #5
Thanks, I get it now. The key is the fact that the expressions evaluate to scalars. John Creighto mentioned that also. I didn't see that before. Thanks to both of you.
 

FAQ: Why is d(x^TCx) equal to x^T(C+C^T)dx?

What is Matrix Calculus?

Matrix calculus is a branch of mathematics that deals with the application of calculus to matrices and vector functions. It involves the differentiation and integration of matrices and vector functions, as well as the use of special rules and identities specific to these operations.

Why is Matrix Calculus important?

Matrix calculus is important because it is a fundamental tool for solving problems in many fields, including physics, engineering, economics, and statistics. It allows us to efficiently and accurately calculate derivatives and integrals of vector functions, which are essential for optimization, modeling, and data analysis.

How is Matrix Calculus different from traditional calculus?

Matrix calculus is similar to traditional calculus in that it deals with the differentiation and integration of functions. However, it is different in that it applies these operations to matrices and vectors instead of single variables. This requires a different set of rules and techniques, such as the use of the chain rule and the product rule for matrix multiplication.

What are some common applications of Matrix Calculus?

Matrix calculus has a wide range of applications in various fields, such as machine learning, computer vision, and quantum mechanics. It is used to optimize neural networks, solve systems of differential equations, and calculate the quantum states of particles, among many other applications.

Are there any resources available for learning Matrix Calculus?

Yes, there are many resources available for learning Matrix Calculus, including textbooks, online tutorials, and video lectures. Some popular books on the subject include "Matrix Calculus" by Magnus and Neudecker, and "The Matrix Cookbook" by Petersen and Pedersen. Additionally, there are several online courses and lectures available on platforms such as Coursera and YouTube.

Similar threads

Replies
1
Views
2K
Replies
3
Views
2K
Replies
5
Views
3K
Back
Top