After you ask AI, and AI give you solution with mathematical formula. You can not directly to copy-paste the result into libreoffice writer nor microsoft word.
1. Ask your AI to show the result in latex format.
2. Copy paste the result into text file e.q. example.text.
3. Create empty odt file e.q. output.odt
4. Use pandoc application to convert it into odt.
$ pandoc -f latex -t odt -o output.odt example.text
if the input file is latin1 encoded, like my text files, the solution is (imo the best output):
$ iconv -f ISO-8859-1 example.text | pandoc -f latex -t odt -o tmp.odt
WARNING: this command will replace any content in tmp.odt and output.odt.
5. Now, you can open odt with mathematical formula.
To install pandoc and iconv (part of libc-bin)
# apt-get install pandoc libc-bin libreoffice-texmaths