# How to extract equations from WolframAlpha step-by-step solution programmatically?

I am calling

ShowSteps[exp_] :=
WolframAlpha[ToString@HoldForm@InputForm@exp, {{"Input", 2}, "Content"},
PodStates -> {"Input__Step-by-step solution"}]

SetAttributes[ShowSteps, HoldAll]
ShowSteps["integrate sin(4x)dx from 0 to 3"]


and am receiving step-by-step solution, just as one would receive in WolframAlpha website after clicking "Step-by-step solution" button. How do I extract everything (as MathML), that is an expression, e.g. all integrals, substitution variables and bounds, basically everything, that is not string (I am currently talking about Step-by-step solutions only for definite integrals)? By extract I mean convert it to MathML and output to file

EDIT:

Just to clarify. I have already got solution:

Now I need to extract everything that is vital to step-by-step solution, in other words, integrals, substitution variables ($u=4x$, $du =4dx$, etc.), convert them to MathML and output to file (I will be adding them to Word document).

• possible duplicate of Get a "step by step" evaluation in Mathematica – hftf Dec 15 '14 at 20:39
• How is this duplicate with question given? Here I already got solution from WolframAlpha (using techniques in article mentioned) in my notebook and I want to extract MathML from that solution (only expressions, no text, to file, later to be copied into Word document) – Kristians Kuhta Dec 15 '14 at 20:46
• To potential closers: the title of this question is similar to what we've seen before, but don't be misguided by that. IMO this is new and on topic. – Sjoerd C. de Vries Dec 15 '14 at 23:15
• I have been looking through the FullForm of the output, but it is a mess of various boxes for which I don't see an easy way to isolate just the equation parts. The problem is that strings may occur in equations and equations in the midst of text. The equations can be selected individually and copied, but I guess that's not what you want. – Sjoerd C. de Vries Dec 16 '14 at 11:48
• Well, I guess it will be very complicated to achieve. For now I will try to achieve that by transforming "Plaintext" form of query to Latex-like language that Word uses. That might be easier. – Kristians Kuhta Dec 16 '14 at 19:00