Automating Mathematics

Working journal

Gradient of Product

A subtle differentiable function is the scalar product,

for a vector space $V$.

Derivative

By Liebniz rule, the total derivative is

Gradient

Note that depends on the vector space structure on $(\mathbb{R}, V)$. For a vector $w$ in $V$, note that we can write

By definition of gradient (as adjoint derivative), we have

Code

We need an additional implicit structure with combinators:

1
2
3
case class InnerProduct[V](dot: (V, V) => Double)

def vdot[V](implicit ip: InnerProduct[V]) = ip.dot

Comments