I would like to know how I can ask Mathematica to expand (and simplify) such an expression :
$$ (\alpha A + \beta B)^\top (\alpha A + \beta B) $$
where $\alpha,\beta$ are two real numbers and $A,B$ are vectors in $\mathbb{R}^{n}$. $A^\top$ denotes the transpose of $A$. I assume I must tell Mathematica that $A$ and $B$ are vectors. Here is what I have tried :
$Assumptions = (A | B) [Element] Vectors[n];
$Assumptions = (a | b) [Element] Reals;
TensorExpand[ Transpose[a*A + b*B].(a*A + b*B) ]
and the output is :
a A.Transpose[a A + b B, {2, 1}] + b B.Transpose[a A + b B, {2, 1}]
Which is not what I expected since I would like the output to be :
$$ \alpha^{2} A^\top A + 2 \alpha \beta A^\top B + \beta^{2} B^\top B $$
TensorReduce
instead ofFullSimplify
. $\endgroup$Vectors[n]
. In your original question you have( a*A + b*B)]*( a*A + b*B)
, instead of*
use.
i.e.Dot
or you can useTensorProduct
. $\endgroup$