Group Abstract Group Abstract

Message Boards Message Boards

0
|
4.1K Views
|
2 Replies
|
2 Total Likes
View groups...
Share
Share this post:

[Solved] Write a function to integrate by substitution?

Posted 4 years ago

Hi, write some lines of Wolfram code to find a solution to an integral using the substitution method:

f[x_] := Power[x, 3]*Power[2 - Power[x, 2], 12]; f[x]
s1 = Integrate[f[x]*Dt[x] /. {x -> Sqrt[2 - u]} /. {2 - x^2 -> u} /. {-2 x*Dt[x] ->1} /. {Dt[u] -> 1}, u]
s2 = Expand[s1]
s3 = s2 /. {u -> 2 - Power[x, 2]}

Try to write a wolfram function to solve integrals using the method (wrong code):

IntSubs[f_, x_, u_] := Integrate[f*Dt[x] /. {x -> u}, u]

Could someone help to write a function to calculate integrals by substitution? Thanks!

image of my notebook

POSTED BY: Roberto Rivero
2 Replies

Here is a way:

f[x_] = Power[x, 3]*Power[2 - Power[x, 2], 12]
inverseSubstitution = u -> 2 - x^2
substitution = Solve[Equal @@ inverseSubstitution, x][[2]]
Inactive[Integrate][(f[x] /. substitution)*
  D[x /. substitution, u], u]
% // Activate
% /. inverseSubstitution
D[%, x] == f[x]
% // Simplify
POSTED BY: Gianluca Gorni
Posted 4 years ago

Thanks, this is helpful. :)

POSTED BY: Roberto Rivero
Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
Attachments
Remove
or Discard