I would like to be able to visually write math equations in lyx and then copy them to wolfram and symbolab to compute the answer. For example I can copy
\left(-1-\lambda\right)\cdot\left(1-\lambda\right)\left(-\lambda\right)+3
into those sites and they will be able to read it and give me the answer, however they do not understand
\begin{pmatrix}1 & 0 & 1\\
0 & 0 & 1\\
-3 & 1 & 3
\end{pmatrix}\cdot\begin{pmatrix}1 & -1 & 0\\
3 & -6 & 1\\
0 & 1 & 0
\end{pmatrix}
Do you have any recommendations for how to format it so that those sites will be able to solve the question?
Best Answer
Wolfram Alpha recognizes
\cdot
, but it is not a full TeX parser. Example for the matrix syntax in Wolfram Alpha (Examples > Mathematics > Matrices & Linear Algebra):The following example defines a macro
\wapmatrix
, which takes a nested comma separated list as matrix like the syntax for Wolfram Alpha and writes the matrix to the screen/.log
file output. Also it translates the matrix to LaTeX and sets the matrix in environmentpmatrix
:Screen/
.log
file:Then the text between the markers can be cut & pasted as query for Wolfram Alpha:
Then it can be copied back to the LaTeX file: