Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
ClearAll[parts, ii]
parts[expr_Plus] := Distribute[Unevaluated[parts[expr]]]
parts[a_ x_] /; NumericQ[a] := a parts[x]
parts[ii[Sin[t] rest_]] :=
Cos[x] (rest /. t -> x) + ii[Cos[t] D[rest, t] // Simplify]
parts[ii[Cos[t] rest_]] := -Sin[x] (rest /. t -> x) -
ii[Sin[t] D[rest, t] // Simplify]
parts[expr_] := expr
Nest[parts, ii[Log[t] Sin[t]/t], 10];
CoefficientList[% /. ii[_] :> 0, {Cos[x], Sin[x], Log[x]}]
Nest[parts, ii[Log[t] Cos[t]/t], 10];
CoefficientList[% /. ii[_] :> 0, {Cos[x], Sin[x], Log[x]}]
Nest[parts, ii[Sin[t]/t], 10];
CoefficientList[% /. ii[_] :> 0, {Cos[x], Sin[x], Log[x]}]
Nest[parts, ii[Cos[t]/t], 10];
CoefficientList[% /. ii[_] :> 0, {Cos[x], Sin[x], Log[x]}]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.