Take the 2-minute tour ×
Mathematica Stack Exchange is a question and answer site for users of Mathematica. It's 100% free, no registration required.

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

1 Answer 1

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

 
discard

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.