# Math: How to typeset a fraction that is part of a fraction?

Kindly help me to typeset this equation using latex

• latex is a typesetting system it does not solve or evaluate any expressions. If you are asking how to evaluate this it is off topic, if you are asking how to typeset it, show a small example and show the error that you got. Apr 25 '20 at 14:14
• I mean how to type this using latex Apr 25 '20 at 14:22
• Maybe try mathpix.com and exerce yourself with the code?
– JeT
Apr 25 '20 at 14:33
• I would think your prior question would help here. Apr 25 '20 at 14:54

Since your comment implied that this question is about typesetting, here you go:

\documentclass{memoir}

\usepackage{amsmath}
\usepackage{sagetex}

\begin{document}
\begin{align*}
\log\frac
{\frac{25}{16} \times \frac{32}{49}}
{\frac{5}{7} \times \frac{5}{7}}
&=\log \frac
{\frac{50}{49}}
{\frac{25}{49}}\\
&=\log 2.\\
\intertext{The following lines utilize \texttt{sagetex}:}
\frac
{\frac{25}{16} \times \frac{32}{49}}
{\frac{5}{7} \times \frac{5}{7}}
&=\sage{(25/16*32/49)/(5/7*5/7)},\\
\log\frac
{\frac{25}{16} \times \frac{32}{49}}
{\frac{5}{7} \times \frac{5}{7}}
&=\log\sage{(25/16*32/49)/(5/7*5/7)},\\
\log\frac
{\frac{25}{16} \times \frac{32}{49}}
{\frac{5}{7} \times \frac{5}{7}}
&=\sage{log((25/16*32/49)/(5/7*5/7))}\\
&\approx\sage{log((25/16*32/49)/(5/7*5/7)).n()}.
\end{align*}
\end{document}

It is not that easy to set up sagetex correctly but might be worth a try, see https://www.ctan.org/pkg/sagetex and https://www.sagemath.org. There might be better ways to put it in good use. Observe that sage's log is the natural logarithm by default. If sagetex has not been set up correctly, you might erase or comment out all lines containing "sage".

This is not the same typeface, though.

• @Sebastiano. Well, I felt kind of challenged by your answer. You got my vote, too. Apr 26 '20 at 13:48
• Ahahahah for my opinion, with all the sincerity, it is not important :-). The importance is the sense of group and reciprocate help. My best regards. But do you have changhed your avatar? Apr 27 '20 at 11:55
• @Sebastiano I agree mostly, but with all due respect, if you are in the low end of reputation, votes are useful for getting privileges on this site. There also might be psychological aspects which might let an answer look better (obviously higher reputation often coincides with more experience and knowledge). I have never set up an avatar, hence the avatar is generated randomly. Apr 27 '20 at 13:20

Confirming the same comment of the very good user @David Carlisle, I have finded, for example, a package (if it is truly the question) named calculator, where it is possible to calculate expressions with LaTeX. I think of it as a kind of algorithm that you should create manually.

Personally for complicated expressions I think it takes a long time to build an algorithm and it is easier to use a scientific calculator. I have created, although not very clearly in the first part, an algorithm that would permit me after, in the frame of the image colored in red, to be able to have the solution of your mathematical expression:

\begin{align*}
\log \frac{\frac{25}{16}\times \frac{32}{49}}{\frac{5}{7}\times \frac{5}{7}}
&= \log \frac{\solE}{\solD}\\
&= \log{\solF}=\sol
\end{align*}

Here there is my complete proposal using this package:

\documentclass[a4paper,12pt]{article}
\usepackage{parskip}
\usepackage{calculator}
\usepackage{mathtools}

\begin{document}
% \solA
\DIVIDE{25}{16}{\solA}
$25/16=\solA$,

% \solB
\DIVIDE{32}{49}{\solB}
$32/49=\solB$,

% \solC
\DIVIDE{5}{7}{\solC}
$5/7=\solC$,

% \solD
\MULTIPLY{0.71428}{0.71428}{\solD}
$0.71428\times0.71428=\solD$,

% \solE
\MULTIPLY{\solA}{\solB}{\solE}
$\solA\times\solB=\solE$,

% \solF (divide argument of the logarithm)
\DIVIDE{\solE}{\solD}{\solF}
$\solF$

% \sol
\LOG{\solF}{\sol}
$\log{\solF}=\sol$

Otherwise more simply:

\begin{align*}
\log \frac{\frac{25}{16}\times \frac{32}{49}}{\frac{5}{7}\times \frac{5}{7}}
&= \log \frac{\solE}{\solD}\\
&= \log{\solF}=\sol
\end{align*}

\end{document}

After, as addendum, it is very important to read this article where there is a complete explanation between the calculator and calculus (also into calculator package - http://mirrors.ctan.org/macros/latex/contrib/calculator/calculator.pdf) packages written by Robert Fuster. Here there is a short example:

\documentclass[a4paper,12pt]{article}
\usepackage[russian,english]{babel}
\usepackage{calculus}%<--------Example 10
\begin{document}
% g(t)=1+cos(t)
\SUMfunction
{\ONEfunction}{\COSfunction}
{\gfunction}
% F(t)=g(t)^2
\COMPOSITIONfunction
{\SQUAREfunction}{\gfunction}
{\Ffunction}
% sol=F(pi/3), Dsol=F’(pi/3)
\Ffunction{\numberTHIRDPI}{\sol}{\Dsol}
\noindent If $f(t)=(1+\cos t)^2$,
then $f(\pi/3)=\sol$ and $f'(\pi/3)=\Dsol$.
\end{document}

• When referring to a file on CTAN please consider to use a mirror independent link like mirrors.ctan.org/macros/latex/contrib/calculator/calculator.pdf. I tend to link to the package itself as reading the fine manual or at least a brief look should be a standard procedure. Apr 27 '20 at 19:46
• @CampanIgnis Welcome. You are authorized to modificate the links....into my question...thank you for your advice.... Apr 27 '20 at 19:49
• It would be great if you could use your answer to contribute to my previously asked question.
– Diaa
Apr 27 '20 at 19:49
• @Diaa thank you very much for your comment...but I'm a scarce user, truly. :-). In this moment I'm voting because, after, I must wiil prepare the tests and the advice for my students. My sincere and best regards...I hope to remember your advice. Apr 27 '20 at 19:53
• @Sebastiano done. Apr 27 '20 at 23:05