向量的导数
A A A为 m × n m \times n m×n的矩阵, x x x为 n × 1 n \times 1 n×1的列向量,则 A x Ax Ax为 m × 1 m \times 1 m×1的列向量,记作 y ⃗ = A ⋅ x ⃗ \vec y = A \cdot \vec x y=A⋅x
A = [ a 11 a 12 ⋯ a 1 n a 21 a 22 ⋯ a 2 n ⋮ ⋮ ⋮ ⋮ a m 1 a m 2 ⋯ a m n ] x ⃗ = [ x 1 x 2 ⋮ x n ] y ⃗ = A ⋅ x ⃗ = [ a 11 x 1 + a 12 x 2 + ⋯ + a 1 n x n a 21 x 1 + a 22 x 2 + ⋯ + a 2 n x n ⋮ a m 1 x 1 + a m 2 x 2 + ⋯ + a m n x n ] A = \begin{bmatrix} a_{11} & a_{12} & \cdots & a_{1n} \\ a_{21} & a_{22} & \cdots & a_{2n} \\ \vdots & \vdots & \vdots & \vdots \\ a_{m1} & a_{m2} & \cdots & a_{mn} \end{bmatrix} \\ ~ \\ \vec x = \begin{bmatrix} x_1 \\ x_2 \\ \vdots \\ x_n \end{bmatrix} \\ ~ \\ \vec y = A \cdot \vec x = \begin{bmatrix} a_{11}x_1 + a_{12}x_2 + \cdots + a_{1n}x_n \\ a_{21}x_1 + a_{22}x_2 + \cdots + a_{2n}x_n \\ \vdots \\ a_{m1}x_1 + a_{m2}x_2 + \cdots + a_{mn}x_n \end{bmatrix} A=⎣⎢⎢⎢⎡a11a21⋮am1a12a22⋮am2⋯⋯⋮⋯a1na2n⋮amn⎦⎥⎥⎥⎤ x=⎣⎢⎢⎢⎡x1x2⋮xn⎦⎥⎥⎥⎤ y=A⋅x=⎣⎢⎢⎢⎡a11x1+a12x2+⋯+a1nxna21x1+a22x2+⋯+a2nxn⋮am1x1+am2x2+⋯+amnxn⎦⎥⎥⎥⎤
∂ y ⃗ ∂ x ⃗ = ∂ A ⋅ x ⃗ ∂ x ⃗ = [ a 11 x 1 + a 12 x 2 + ⋯ + a 1 n x n x 1 a 21 x 1 + a 22 x 2 + ⋯ + a 2 n x n x 1 ⋯ a m 1 x 1 + a 1 m 2 x 2 + ⋯ + a m n x 1 x 1 a 11 x 1 + a 12 x 2 + ⋯ + a 1 n x n x 2 a 21 x 1 + a 22 x 2 + ⋯ + a 2 n x n x 2 ⋯ a m 1 x 1 + a m 2 x 2 + ⋯ + a m n x n x 2 ⋮ ⋮ ⋮ ⋮ a 11 x 1 + a 12 x 2 + ⋯ + a 1 n x n x n a 21 x 1 + a 22 x 2 + ⋯ + a 2 n x n x n ⋯ a m 1 x 1 + a m 2 x 2 + ⋯ + a m n x n x n ] = [ a 11 a 21 ⋯ a m 1 a 12 a 22 ⋯ a m 2 ⋮ ⋮ ⋮ ⋮ a 1 n a 2 n ⋯ a m n ] = A T \frac{\partial \vec y}{\partial \vec x} = \frac{\partial A \cdot \vec x}{\partial \vec x} = \begin{bmatrix} \frac{a_{11}x_1 + a_{12}x_2 + \cdots + a_{1n}x_n}{x_1} & \frac{a_{21}x_1 + a_{22}x_2 + \cdots + a_{2n}x_n}{x_1} & \cdots & \frac{a_{m1}x_1 + a_{1m2}x_2 + \cdots + a_{mn}x_1}{x_1}\\ \frac{a_{11}x_1 + a_{12}x_2 + \cdots + a_{1n}x_n}{x_2} & \frac{a_{21}x_1 + a_{22}x_2 + \cdots + a_{2n}x_n}{x_2} & \cdots & \frac{a_{m1}x_1 + a_{m2}x_2 + \cdots + a_{mn}x_n}{x_2}\\ \vdots & \vdots & \vdots& \vdots \\ \frac{a_{11}x_1 + a_{12}x_2 + \cdots + a_{1n}x_n}{x_n} & \frac{a_{21}x_1 + a_{22}x_2 + \cdots + a_{2n}x_n}{x_n} & \cdots & \frac{a_{m1}x_1 + a_{m2}x_2 + \cdots + a_{mn}x_n}{x_n}\\ \end{bmatrix} \\ ~ \\ = \begin{bmatrix} a_{11} & a_{21} & \cdots & a_{m1} \\ a_{12} & a_{22} & \cdots & a_{m2} \\ \vdots & \vdots & \vdots & \vdots \\ a_{1n} & a_{2n} & \cdots & a_{mn} \end{bmatrix} = A^T ∂x∂y=∂x∂A⋅x=⎣⎢⎢⎢⎡x1a11x1+a12x2+⋯+a1nxnx2a11x1+a12x2+⋯+a1nxn⋮xna11x1+a12x2+⋯+a1nxnx1a21x1+a22x2+⋯+a2nxnx2a21x1+a22x2+⋯+a2nxn⋮xna21x1+a22x2+⋯+a2nxn⋯⋯⋮⋯x1am1x1+a1m2x2+⋯+amnx1x2am1x1+am2x2+⋯+amnxn⋮xnam1x1+am2x2+⋯+amnxn⎦⎥⎥⎥⎤ =⎣⎢⎢⎢⎡a11a12⋮a1na21a22⋮a2n⋯⋯⋮⋯am1am2⋮amn⎦⎥⎥⎥⎤=AT
∂ y ⃗ ∂ ( x ⃗ ) T = ∂ A ⋅ x ⃗ ∂ ( x ⃗ ) T = [ a 11 x 1 + a 12 x 2 + ⋯ + a 1 n x n x 1 a 11 x 1 + a 12 x 2 + ⋯ + a 1 n x n x 2 ⋯ a 11 x 1 + a 12 x 2 + ⋯ + a 1 n x 1 x n a 21 x 1 + a 22 x 2 + ⋯ + a 2 n x n x 1 a 21 x 1 + a 22 x 2 + ⋯ + a 2 n x n x 2 ⋯ a 21 x 1 + a 22 x 2 + ⋯ + a 2 n x n x n ⋮ ⋮ ⋮ ⋮ a m 1 x 1 + a m 2 x 2 + ⋯ + a m n x n x 1 a m 1 x 1 + a m 2 x 2 + ⋯ + a m n x n x 2 ⋯ a m 1 x 1 + a m 2 x 2 + ⋯ + a m n x n x n ] = [ a 11 a 12 ⋯ a 1 n a 21 a 22 ⋯ a 2 n ⋮ ⋮ ⋮ ⋮ a m 1 a m 2 ⋯ a m n ] = A \frac{\partial \vec y}{\partial (\vec x)^T} = \frac{\partial A \cdot \vec x}{\partial (\vec x)^T} = \begin{bmatrix} \frac{a_{11}x_1 + a_{12}x_2 + \cdots + a_{1n}x_n}{x_1} & \frac{a_{11}x_1 + a_{12}x_2 + \cdots + a_{1n}x_n}{x_2} & \cdots & \frac{a_{11}x_1 + a_{12}x_2 + \cdots + a_{1n}x_1}{x_n}\\ \frac{a_{21}x_1 + a_{22}x_2 + \cdots + a_{2n}x_n}{x_1} & \frac{a_{21}x_1 + a_{22}x_2 + \cdots + a_{2n}x_n}{x_2} & \cdots & \frac{a_{21}x_1 + a_{22}x_2 + \cdots + a_{2n}x_n}{x_n}\\ \vdots & \vdots & \vdots& \vdots \\ \frac{a_{m1}x_1 + a_{m2}x_2 + \cdots + a_{mn}x_n}{x_1} & \frac{a_{m1}x_1 + a_{m2}x_2 + \cdots + a_{mn}x_n}{x_2} & \cdots & \frac{a_{m1}x_1 + a_{m2}x_2 + \cdots + a_{mn}x_n}{x_n}\\ \end{bmatrix} \\ ~ \\ = \begin{bmatrix} a_{11} & a_{12} & \cdots & a_{1n} \\ a_{21} & a_{22} & \cdots & a_{2n} \\ \vdots & \vdots & \vdots & \vdots \\ a_{m1} & a_{m2} & \cdots & a_{mn} \end{bmatrix} = A ∂(x)T∂y=∂(x)T∂A⋅x=⎣⎢⎢⎢⎡x1a11x1+a12x2+⋯+a1nxnx1a21x1+a22x2+⋯+a2nxn⋮x1am1x1+am2x2+⋯+amnxnx2a11x1+a12x2+⋯+a1nxnx2a21x1+a22x2+⋯+a2nxn⋮x2am1x1+am2x2+⋯+amnxn⋯⋯⋮⋯xna11x1+a12x2+⋯+a1nx1xna21x1+a22x2+⋯+a2nxn⋮xnam1x1+am2x2+⋯+amnxn⎦⎥⎥⎥⎤ =⎣⎢⎢⎢⎡a11a21⋮am1a12a22⋮am2⋯⋯⋮⋯a1na2n⋮amn⎦⎥⎥⎥⎤=A
x ⃗ T ⋅ A = [ x 1 x 2 ⋯ x n ] ⋅ [ a 11 a 12 ⋯ a 1 n a 21 a 22 ⋯ a 2 n ⋮ ⋮ ⋮ ⋮ a m 1 a m 2 ⋯ a m n ] = [ a 11 x 1 + a 21 x 2 + ⋯ + a m 1 x n a 12 x 1 + a 22 x 2 + ⋯ + a m 2 x n ⋯ a 1 n x 1 + a 2 n x 2 + ⋯ + a m n x n ] ∂ ( x ⃗ T ⋅ A ) ∂ x ⃗ = [ a 11 x 1 + a 21 x 2 + ⋯ + a m 1 x n x 1 a 12 x 1 + a 22 x 2 + ⋯ + a m 2 x n x 1 ⋯ a 1 n x 1 + a 2 n x 1 + ⋯ + a m n x n x 1 a 11 x 1 + a 21 x 2 + ⋯ + a m 1 x n x 2 a 12 x 1 + a 22 x 2 + ⋯ + a m 2 x n x 2 ⋯ a 1 n x 1 + a 2 n x 2 + ⋯ + a m n x n x 2 ⋮ ⋮ ⋮ ⋮ a 11 x 1 + a 21 x 2 + ⋯ + a m 1 x n x n a 12 x 1 + a 22 x 1 + ⋯ + a m 2 x n x n ⋯ a 1 n x 1 + a 2 n x 1 + ⋯ + a m n x n x n ] = [ a 11 a 12 ⋯ a 1 n a 21 a 22 ⋯ a 2 n ⋮ ⋮ ⋮ ⋮ a m 1 a m 2 ⋮ a m n ] = A {\vec x}^T \cdot A = \begin{bmatrix} x_1 & x_2 & \cdots & x_n \end{bmatrix} \cdot \begin{bmatrix} a_{11} & a_{12} & \cdots & a_{1n} \\ a_{21} & a_{22} & \cdots & a_{2n} \\ \vdots & \vdots & \vdots & \vdots \\ a_{m1} & a_{m2} & \cdots & a_{mn} \end{bmatrix} \\ = \begin{bmatrix} a_{11}x_1+ a_{21}x_2 + \cdots + a_{m1}x_n & a_{12}x_1+ a_{22}x_2 + \cdots + a_{m2}x_n & \cdots & a_{1n}x_1+ a_{2n}x_2 + \cdots + a_{mn}x_n \end{bmatrix} \\ ~ \\ \frac{\partial ({\vec x}^T \cdot A)}{\partial \vec x} = \begin{bmatrix} \frac{a_{11}x_1+ a_{21}x_2 + \cdots + a_{m1}x_n }{x_1} & \frac{a_{12}x_1+ a_{22}x_2 + \cdots + a_{m2}x_n}{x_1} & \cdots & \frac{a_{1n}x_1+ a_{2n}x_1 + \cdots + a_{mn}x_n}{x_1} \\ \\ \frac{a_{11}x_1+ a_{21}x_2 + \cdots + a_{m1}x_n }{x_2} & \frac{a_{12}x_1+ a_{22}x_2 + \cdots + a_{m2}x_n}{x_2} & \cdots & \frac{a_{1n}x_1+ a_{2n}x_2 + \cdots + a_{mn}x_n}{x_2} \\ \vdots & \vdots & \vdots & \vdots \\ \\ \frac{a_{11}x_1+ a_{21}x_2 + \cdots + a_{m1}x_n }{x_n} & \frac{a_{12}x_1+ a_{22}x_1 + \cdots + a_{m2}x_n}{x_n} & \cdots & \frac{a_{1n}x_1+ a_{2n}x_1 + \cdots + a_{mn}x_n}{x_n} \end{bmatrix} \\ ~ \\ =\begin{bmatrix} a_{11} & a_{12} & \cdots & a_{1n} \\ a_{21} & a_{22} & \cdots & a_{2n} \\ \vdots & \vdots & \vdots & \vdots \\ a_{m1} & a_{m2} & \vdots & a_{mn} \end{bmatrix} = A xT⋅A=[x1x2⋯xn]⋅⎣⎢⎢⎢⎡a11a21⋮am1a12a22⋮am2⋯⋯⋮⋯a1na2n⋮amn⎦⎥⎥⎥⎤=[a11x1+a21x2+⋯+am1xna12x1+a22x2+⋯+am2xn⋯a1nx1+a2nx2+⋯+amnxn] ∂x∂(xT⋅A)=⎣⎢⎢⎢⎢⎢⎢⎢⎡x1a11x1+a21x2+⋯+am1xnx2a11x1+a21x2+⋯+am1xn⋮xna11x1+a21x2+⋯+am1xnx1a12x1+a22x2+⋯+am2xnx2a12x1+a22x2+⋯+am2xn⋮xna12x1+a22x1+⋯+am2xn⋯⋯⋮⋯x1a1nx1+a2nx1+⋯+amnxnx2a1nx1+a2nx2+⋯+amnxn⋮xna1nx1+a2nx1+⋯+amnxn⎦⎥⎥⎥⎥⎥⎥⎥⎤ =⎣⎢⎢⎢⎢⎡a11a21⋮am1a12a22⋮am2⋯⋯⋮⋮a1na2n⋮amn⎦⎥⎥⎥⎥⎤=A
A
A
A为
n
×
n
n \times n
n×n的矩阵,
x
⃗
\vec x
x为
n
×
1
n \times 1
n×1的列向量,记
y
=
(
x
⃗
)
T
⋅
A
⋅
x
⃗
y = (\vec x)^T \cdot A \cdot \vec x
y=(x)T⋅A⋅x
A
=
[
a
11
a
12
⋯
a
1
n
a
21
a
22
⋯
a
2
n
⋮
⋮
⋮
⋮
a
n
1
a
n
2
⋯
a
n
n
]
x
⃗
=
[
x
1
x
2
⋮
x
n
]
(
x
⃗
)
T
=
[
x
1
x
2
⋯
x
n
]
x
⃗
T
⋅
A
=
[
x
1
x
2
⋯
x
n
]
⋅
[
a
11
a
12
⋯
a
1
n
a
21
a
22
⋯
a
2
n
⋮
⋮
⋮
⋮
a
n
1
a
n
2
⋯
a
n
n
]
=
[
a
11
x
1
+
a
21
x
2
+
⋯
+
a
n
1
x
n
a
12
x
1
+
a
22
x
2
+
⋯
+
a
n
2
x
n
⋯
a
1
n
x
1
+
a
2
n
x
2
+
⋯
+
a
n
n
x
n
]
(
x
⃗
)
T
⋅
A
⋅
x
⃗
=
(
a
11
x
1
+
a
21
x
2
+
⋯
+
a
n
1
x
n
)
x
1
+
(
a
12
x
1
+
a
22
x
2
+
⋯
+
a
n
2
x
n
)
x
2
+
⋯
+
(
a
1
n
x
1
+
a
2
n
x
2
+
⋯
+
a
n
n
x
n
)
x
n
=
y
A = \begin{bmatrix} a_{11} & a_{12} & \cdots & a_{1n} \\ a_{21} & a_{22} & \cdots & a_{2n} \\ \vdots & \vdots & \vdots & \vdots \\ a_{n1} & a_{n2} & \cdots & a_{nn} \end{bmatrix} \\ ~ \\ \vec x = \begin{bmatrix} x_1 \\ x_2 \\ \vdots \\ x_n \end{bmatrix} \\ ~ \\ (\vec x)^T = \begin{bmatrix} x_1 & x_2 & \cdots & x_n\end{bmatrix} \\ ~ \\ {\vec x}^T \cdot A = \begin{bmatrix} x_1 & x_2 & \cdots & x_n \end{bmatrix} \cdot \begin{bmatrix} a_{11} & a_{12} & \cdots & a_{1n} \\ a_{21} & a_{22} & \cdots & a_{2n} \\ \vdots & \vdots & \vdots & \vdots \\ a_{n1} & a_{n2} & \cdots & a_{nn} \end{bmatrix} \\ = \begin{bmatrix} a_{11}x_1+ a_{21}x_2 + \cdots + a_{n1}x_n & a_{12}x_1+ a_{22}x_2 + \cdots + a_{n2}x_n & \cdots & a_{1n}x_1+ a_{2n}x_2 + \cdots + a_{nn}x_n \end{bmatrix} \\ ~ \\ (\vec x)^T \cdot A \cdot \vec x = \\ ~ \\ (a_{11}x_1+ a_{21}x_2 + \cdots + a_{n1}x_n)x_1 + (a_{12}x_1+ a_{22}x_2 + \cdots + a_{n2}x_n)x_2 + \cdots + (a_{1n}x_1+ a_{2n}x_2 + \cdots + a_{nn}x_n)x_n = y
A=⎣⎢⎢⎢⎡a11a21⋮an1a12a22⋮an2⋯⋯⋮⋯a1na2n⋮ann⎦⎥⎥⎥⎤ x=⎣⎢⎢⎢⎡x1x2⋮xn⎦⎥⎥⎥⎤ (x)T=[x1x2⋯xn] xT⋅A=[x1x2⋯xn]⋅⎣⎢⎢⎢⎡a11a21⋮an1a12a22⋮an2⋯⋯⋮⋯a1na2n⋮ann⎦⎥⎥⎥⎤=[a11x1+a21x2+⋯+an1xna12x1+a22x2+⋯+an2xn⋯a1nx1+a2nx2+⋯+annxn] (x)T⋅A⋅x= (a11x1+a21x2+⋯+an1xn)x1+(a12x1+a22x2+⋯+an2xn)x2+⋯+(a1nx1+a2nx2+⋯+annxn)xn=y
∂ y ∂ x ⃗ = [ ( a 11 x 1 + a 21 x 2 + ⋯ + a n 1 x n ) x 1 + ( a 12 x 1 + a 22 x 2 + ⋯ + a n 2 x n ) x 2 + ⋯ + ( a 1 n x 1 + a 2 n x 2 + ⋯ + a n n x n ) x n x 1 ( a 11 x 1 + a 21 x 2 + ⋯ + a n 1 x n ) x 1 + ( a 12 x 1 + a 22 x 2 + ⋯ + a n 2 x n ) x 2 + ⋯ + ( a 1 n x 1 + a 2 n x 2 + ⋯ + a n n x n ) x n x 2 ⋮ ( a 11 x 1 + a 21 x 2 + ⋯ + a n 1 x n ) x 1 + ( a 12 x 1 + a 22 x 2 + ⋯ + a n 2 x n ) x 2 + ⋯ + ( a 1 n x 1 + a 2 n x 2 + ⋯ + a n n x n ) x n x n ] = [ ( 2 a 11 x 1 + a 21 x 2 + ⋯ + a n 1 x n ) + ( a 12 x 2 ) + ⋯ + a 1 n x n ( a 21 x 1 ) + ( a 12 x 1 + 2 a 22 x 2 + ⋯ + a n 2 x n ) x 2 + ⋯ + a 2 n x n ⋮ ( a n 1 x 1 ) + a n 2 x 2 + ⋯ + ( a 1 n x 1 + a 2 n x 2 + ⋯ + 2 a n n x n ) ] = [ 2 a 11 x 1 + a 21 x 2 + ( a 12 x 2 ) + ⋯ + a 1 n x n + a n 1 x n ) a 21 x 1 + a 12 x 1 + 2 a 22 x 2 + ⋯ + a 2 n x n + a n 2 x n ⋮ ( a n 1 x 1 ) + a 1 n x 1 + a n 2 x 2 + a 2 n x 2 + ⋯ + 2 a n n x n ) ] = = [ 2 a 11 x 1 + ( a 21 + a 12 ) x 2 + ⋯ + ( a 1 n + a n 1 ) x n ) ( a 21 + a 12 ) x 1 + 2 a 22 x 2 + ⋯ + ( a 2 n + a n 2 ) x n ⋮ ( a n 1 + a 1 n ) x 1 + ( a n 2 + a 2 n ) x 2 + ⋯ + 2 a n n x n ) ] A T + A = [ a 11 a 21 ⋯ a n 1 a 12 a 22 ⋯ a n 2 ⋮ ⋮ ⋮ ⋮ a 1 n a 2 n ⋯ a n n ] + [ a 11 a 12 ⋯ a 1 n a 21 a 22 ⋯ a 2 n ⋮ ⋮ ⋮ ⋮ a n 1 a n 2 ⋯ a n n ] = [ 2 a 11 a 12 + a 21 ⋯ a 1 n + a n 1 a 21 + a 21 2 a 22 ⋯ a 2 n + a n 2 ⋮ ⋮ ⋮ ⋮ a n 1 + a n 1 a n 2 + a 2 n ⋯ 2 a n n ] ( A T + A ) ⋅ x ⃗ = [ 2 a 11 x 1 + ( a 12 + a 21 ) x 2 + ⋯ + ( a 1 n + a n 1 ) x n ( a 21 + a 21 ) x 1 + 2 a 22 x 2 + ⋯ + ( a 2 n + a n 2 ) x n ⋮ ( a n 1 + a n 1 ) x 1 + ( a n 2 + a 2 n ) x 2 + ⋯ + 2 a n n x n ] ∴ ∂ y ∂ x ⃗ = ( A T + A ) ⋅ x ⃗ \frac{\partial y}{\partial \vec x} = \begin{bmatrix} \frac{(a_{11}x_1+ a_{21}x_2 + \cdots + a_{n1}x_n)x_1 + (a_{12}x_1+ a_{22}x_2 + \cdots + a_{n2}x_n)x_2 + \cdots + (a_{1n}x_1+ a_{2n}x_2 + \cdots + a_{nn}x_n)x_n }{x_1} \\ \frac{(a_{11}x_1+ a_{21}x_2 + \cdots + a_{n1}x_n)x_1 + (a_{12}x_1+ a_{22}x_2 + \cdots + a_{n2}x_n)x_2 + \cdots + (a_{1n}x_1+ a_{2n}x_2 + \cdots + a_{nn}x_n)x_n}{x_2} \\ \vdots \\ \frac{(a_{11}x_1+ a_{21}x_2 + \cdots + a_{n1}x_n)x_1 + (a_{12}x_1+ a_{22}x_2 + \cdots + a_{n2}x_n)x_2 + \cdots + (a_{1n}x_1+ a_{2n}x_2 + \cdots + a_{nn}x_n)x_n }{x_n} \end{bmatrix} \\ ~ \\ =\begin{bmatrix} (2a_{11}x_1+ a_{21}x_2 + \cdots + a_{n1}x_n) + (a_{12}x_2) + \cdots + a_{1n}x_n \\ (a_{21}x_1) + (a_{12}x_1+ 2a_{22}x_2 + \cdots + a_{n2}x_n)x_2 + \cdots + a_{2n}x_n \\ \vdots \\ (a_{n1}x_1) +a_{n2}x_2 + \cdots + (a_{1n}x_1+ a_{2n}x_2 + \cdots + 2a_{nn}x_n) \end{bmatrix} \\ ~ \\ =\begin{bmatrix} 2a_{11}x_1+ a_{21}x_2 + (a_{12}x_2) +\cdots + a_{1n}x_n + a_{n1}x_n) \\ a_{21}x_1 +a_{12}x_1 + 2a_{22}x_2 + \cdots + a_{2n}x_n + a_{n2}x_n \\ \vdots \\ (a_{n1}x_1) +a_{1n}x_1 + a_{n2}x_2 + a_{2n}x_2 +\cdots + 2a_{nn}x_n) \end{bmatrix} \\ ~ \\ ==\begin{bmatrix} 2a_{11}x_1+ (a_{21} + a_{12})x_2 +\cdots + (a_{1n} + a_{n1})x_n) \\ (a_{21} +a_{12})x_1 + 2a_{22}x_2 + \cdots + (a_{2n} + a_{n2})x_n \\ \vdots \\ (a_{n1}+a_{1n})x_1 + (a_{n2}+ a_{2n})x_2 +\cdots + 2a_{nn}x_n) \end{bmatrix} \\ ~ \\ A^T + A =\begin{bmatrix} a_{11} & a_{21} & \cdots & a_{n1} \\ a_{12} & a_{22} & \cdots & a_{n2} \\ \vdots & \vdots & \vdots & \vdots \\ a_{1n} & a_{2n} & \cdots & a_{nn} \end{bmatrix} + \begin{bmatrix} a_{11} & a_{12} & \cdots & a_{1n} \\ a_{21} & a_{22} & \cdots & a_{2n} \\ \vdots & \vdots & \vdots & \vdots \\ a_{n1} & a_{n2} & \cdots & a_{nn} \end{bmatrix} \\~ \\ = \begin{bmatrix} 2a_{11} & a_{12} + a_{21} & \cdots & a_{1n} + a_{n1}\\ a_{21} + a_{21}& 2a_{22} & \cdots & a_{2n} + a_{n2}\\ \vdots & \vdots & \vdots & \vdots \\ a_{n1} + a_{n1}& a_{n2} + a_{2n}& \cdots & 2a_{nn} \end{bmatrix} \\ ~ \\ (A^T + A) \cdot \vec x = \begin{bmatrix} 2a_{11} x_1 + (a_{12} + a_{21})x_2 + \cdots + (a_{1n} + a_{n1})x_n\\ (a_{21} +a_{21})x_1+ 2a_{22} x_2+ \cdots +( a_{2n} + a_{n2})x_n\\ \vdots \\ (a_{n1} + a_{n1})x_1+ (a_{n2} + a_{2n})x_2 +\cdots + 2a_{nn}x_n \end{bmatrix} \\ ~ \\ \therefore \frac{\partial y}{\partial \vec x} = (A^T + A) \cdot \vec x ∂x∂y=⎣⎢⎢⎢⎢⎡x1(a11x1+a21x2+⋯+an1xn)x1+(a12x1+a22x2+⋯+an2xn)x2+⋯+(a1nx1+a2nx2+⋯+annxn)xnx2(a11x1+a21x2+⋯+an1xn)x1+(a12x1+a22x2+⋯+an2xn)x2+⋯+(a1nx1+a2nx2+⋯+annxn)xn⋮xn(a11x1+a21x2+⋯+an1xn)x1+(a12x1+a22x2+⋯+an2xn)x2+⋯+(a1nx1+a2nx2+⋯+annxn)xn⎦⎥⎥⎥⎥⎤ =⎣⎢⎢⎢⎡(2a11x1+a21x2+⋯+an1xn)+(a12x2)+⋯+a1nxn(a21x1)+(a12x1+2a22x2+⋯+an2xn)x2+⋯+a2nxn⋮(an1x1)+an2x2+⋯+(a1nx1+a2nx2+⋯+2annxn)⎦⎥⎥⎥⎤ =⎣⎢⎢⎢⎡2a11x1+a21x2+(a12x2)+⋯+a1nxn+an1xn)a21x1+a12x1+2a22x2+⋯+a2nxn+an2xn⋮(an1x1)+a1nx1+an2x2+a2nx2+⋯+2annxn)⎦⎥⎥⎥⎤ ==⎣⎢⎢⎢⎡2a11x1+(a21+a12)x2+⋯+(a1n+an1)xn)(a21+a12)x1+2a22x2+⋯+(a2n+an2)xn⋮(an1+a1n)x1+(an2+a2n)x2+⋯+2annxn)⎦⎥⎥⎥⎤ AT+A=⎣⎢⎢⎢⎡a11a12⋮a1na21a22⋮a2n⋯⋯⋮⋯an1an2⋮ann⎦⎥⎥⎥⎤+⎣⎢⎢⎢⎡a11a21⋮an1a12a22⋮an2⋯⋯⋮⋯a1na2n⋮ann⎦⎥⎥⎥⎤ =⎣⎢⎢⎢⎡2a11a21+a21⋮an1+an1a12+a212a22⋮an2+a2n⋯⋯⋮⋯a1n+an1a2n+an2⋮2ann⎦⎥⎥⎥⎤ (AT+A)⋅x=⎣⎢⎢⎢⎡2a11x1+(a12+a21)x2+⋯+(a1n+an1)xn(a21+a21)x1+2a22x2+⋯+(a2n+an2)xn⋮(an1+an1)x1+(an2+a2n)x2+⋯+2annxn⎦⎥⎥⎥⎤ ∴∂x∂y=(AT+A)⋅x