## LaTeX forum ⇒ LyX ⇒ Question about LyX and Maxima Collaboration

Information and discussion about LyX, a WYSIWYM editor, available for Linux, Windows and Mac OS X systems.
dpa2007
Posts: 16
Joined: Sat Apr 19, 2014 1:39 pm

### Question about LyX and Maxima Collaboration

Greetings i'm using LyX and Maxima as CAS a few weeks.
Trying to compute the limit of a sequence i get no answer.
is a problem of my notation,problem of LyX or Maxima?
in other problems when changing the notation Maxima computed successfully the limit.
Any help...?

the limit is:
\lim_{n\rightarrow\infty}\left(\frac{\sin\left(\frac{n\cdot\pi}{3}\right)}{n^{2}}\right)

lim.png (966 Bytes) Viewed 6072 times
Last edited by cgnieder on Tue Jun 17, 2014 11:45 am, edited 6 times in total.
Reason: uploaded picture to latex-community server (this is preferable to external links)

Tags:

Johannes_B
Site Moderator
Posts: 4163
Joined: Thu Nov 01, 2012 4:08 pm
To be honest, i don't understand the question.
Can you be a bit more coomprehensive on your workflow? Is the problem typesetting, i.e. getting a valid pdf file?
The smart way: Calm down and take a deep breath, read posts and provided links attentively, try to understand and ask if necessary.

dpa2007
Posts: 16
Joined: Sat Apr 19, 2014 1:39 pm
LyX does not calculate the limit when i call Maxima from the path:
Edit>Math>use Computer Algebra System>Maxima.
in other cases Maxima gives back the correct answer,calculating for example the limit.
I'm wondering if this is a problem of Maxima or LyX.
It seems to calculate some limits for example and few others not.

StarValkyrie
Posts: 89
Joined: Fri Jan 24, 2014 12:42 am
Can you post the source for at least one problem that does get solved and at least one that doesn't get solved please?

dpa2007
Posts: 16
Joined: Sat Apr 19, 2014 1:39 pm
Solved!
the problem was in pi symbol,
when using the pi from the Greek's lyx menu (π) maxima did not understand( ) the symbol and returns the same expression.
when i change the Pi symbol with the 3.14 maxima has return the correct output.

and the result:
\lim_{n\rightarrow\infty}\left(\frac{\sin\left(\frac{n\cdot\pi}{3}\right)}{n^{2}}\right)&=&\lim_{n\rightarrow\infty}{\frac{\sin\left(\frac{n\,\pi}{3}\right)}{n^{2}}}\hspace{10 mm}\lim_{n\rightarrow\infty}\left(\frac{\sin\left(n\cdot3.14\right)}{n^{2}}\right)	=0

lim.png (2.5 KiB) Viewed 6072 times

Is it a way to make maxima understand pi from LyX?
Last edited by cgnieder on Tue Jun 17, 2014 11:47 am, edited 1 time in total.
Reason: uploaded picture to latex-community server (this is preferable to external links)

StarValkyrie
Posts: 89
Joined: Fri Jan 24, 2014 12:42 am
I don't use Maxima, but looking at the code you posted, nothing is jumping out as wrong. Maxima clearly isn't understanding something in the top of that fraction, but I don't know what. You mentioned using the Insert menu for pi so my first thought was that you might have ended up with the non-math code LyX uses for single symbols which would have been \textgreek{p}, but you're obviously in math mode and LyX did the conversion to \pi correctly there according to the code you posted, so that's probably not the issue. Just in case though, to get the math symbol while in math mode (or a math environment found in the Insert>Math menu), you don't need to go through the Insert menu --- just type "\pi " - the space after is important - and then you can be sure the code will be correct and Maxima will be able to read it. You can accomplish the same thing using the greek button (it has an alpha on it - if there aren't two toolbars at the bottom of your screen when you're in math mode, you can toggle the first by hitting the sigma button at the top of your screen and then the second by hitting the pi button on the one that appears at the bottom.) on the math toolbar and choosing pi there, but it's usually faster to just type the LaTeX.

dpa2007
Posts: 16
Joined: Sat Apr 19, 2014 1:39 pm
correct!
maxima did not understand the pi.
i have tried the use of % in LyX and Maxima returned the correct answers.

\lim_{n\rightarrow\infty}\left(\frac{\sin\left(n\cdot3.14\right)}{n^{2}}\right)=0\hspace{10 mm}\newline\lim_{n\rightarrow\infty}\left(\frac{\sin\left(n\cdot\%pi\right)}{n^{2}}\right)=0\hspace{10 mm}\newline\lim_{n\rightarrow\infty}\left(\frac{\sin\left(\frac{n\cdot\%pi}{3}\right)}{n^{2}}\right)=0

lim1.png (3.67 KiB) Viewed 6072 times

and another one example with the use of % in LyX
\lim_{n\rightarrow\infty}\left(\frac{\sin\left(\frac{n\cdot\%\pi}{3}\right)}{n^{2}}\right)&=&0

lim2.png (1.36 KiB) Viewed 6072 times

The answer is correct and Maxima returned no error result.
Last edited by cgnieder on Tue Jun 17, 2014 11:49 am, edited 1 time in total.
Reason: uploaded picture to latex-community server (this is preferable to external links)