Mathematica Stack Exchange is a question and answer site for users of Mathematica. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

When I can't remember an integral I usually just query wolfram and have it show steps.

This was my naive attempt at trying to make a simpler function.

 wolfram[query_] = 
 WolframAlpha[ToString[query], IncludePods -> "Input", 
  AppearanceElements -> {"Pods"}, PodStates -> {"Input__Show steps"}]

It doesn't work. I'm completely clueless :) More generally I'm asking: How would I create a permanent function to simplify something this... verbose ?

share|improve this question
up vote 5 down vote accepted

For indefinite integrals where "Show Steps" is available, the pod state is "IndefiniteIntegral__Step-by-step solution". The following works for cases where W|A can show the steps.

showSteps[query_] := WolframAlpha[
    "integrate " <> ToString[query], 
    {{"IndefiniteIntegral", 2}, "Content"}, 
    PodStates -> {"IndefiniteIntegral__Step-by-step solution"}

enter image description here

The 2 in the second argument refers to the hidden steps. Using 1 instead will give you the formatted result.

To get a computable result (formatting free) from W|A, you can use the following:

integrate[query_] := WolframAlpha[
    "integrate " <> ToString[query], 
    {{"IndefiniteIntegral", 1}, "ComputableData"}, 
    PodStates -> {"IndefiniteIntegral__Step-by-step solution"}

integrate["sin(x)^2"] // InputForm
(* Hold[Integrate[Sin[x]^2, x] == (x - Cos[x]*Sin[x])/2] *)
share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.