1
$\begingroup$

I want to use of collect for this code:

x^α (9/(100 α κ Gamma[α]) - x/(
    100 (α + α^2) κ Gamma[α]) - Subscript[
    a, 0]/(α Gamma[α])) + 
 x^(2 α) ((
    2^(2 - 2 α)
      Cos[π α] Gamma[1/2 - α] Subscript[a, 0])/(
    5 Sqrt[π] α κ Gamma[α]) - (
    x Subscript[a, 0])/(10 κ Gamma[2 + 2 α]) - (
    x Gamma[2 + α] Subscript[a, 0])/(
    10 α κ Gamma[α] Gamma[2 + 2 α]) - (
    2^(-2 α) Sqrt[π] Subscript[a, 1])/
    Gamma[1/2 + α])

so that we have power to form of

x   x^α   x^(2α)  x^(3α)  ...

that

Collect

I have reviewed these answers Collect1 collect2 but I did not understand. Any suggestion?

$\endgroup$
7
  • $\begingroup$ How is this different than your last question? You've asked a lot of questions about this in the last few days, and it seems you haven't gotten an acceptable answer. Perhaps you need to give more details. Anyway, what's wrong with Collect[expr, x^_]? $\endgroup$
    – march
    Commented Apr 9, 2016 at 15:03
  • $\begingroup$ @march I deleted that question, because that is not my opinion. This question is not the same with it. $\endgroup$ Commented Apr 9, 2016 at 15:12
  • $\begingroup$ Neither of the two answers cited in the question relate to Collect. As suggested earlier by @march, use Collect[exp, x^α, Simplify] or some variant of it. $\endgroup$
    – bbgodfrey
    Commented Apr 9, 2016 at 17:42
  • $\begingroup$ @bbgodfrey I used this code but "Simplify" is not good, and " x" is not in collect. I want "Ax+B x^α+C*x^2α + . . . ". $\endgroup$ Commented Apr 9, 2016 at 17:48
  • $\begingroup$ The expression contain terms proportional to (x^α), x^(2 α), x^(1 + α), and x^(1 + 2 α), so it cannot look like what your want. $\endgroup$
    – bbgodfrey
    Commented Apr 9, 2016 at 18:02

1 Answer 1

1
$\begingroup$
expr = x^α (9/(100 α κ Gamma[α]) - 
      x/(100 (α + α^2) κ Gamma[α]) - 
      Subscript[a, 0]/(α Gamma[α])) + 
   x^(2 α) ((2^(2 - 2 α) Cos[π α] Gamma[
          1/2 - α] Subscript[a, 
          0])/(5 Sqrt[π] α κ Gamma[α]) - (x \
Subscript[a, 0])/(10 κ Gamma[2 + 2 α]) - (x Gamma[
          2 + α] Subscript[a, 
          0])/(10 α κ Gamma[α] Gamma[
          2 + 2 α]) - (2^(-2 α) Sqrt[π] Subscript[a, 1])/
       Gamma[1/2 + α]);

If your intent is to allow the coefficients to contain terms with an x factor

TraditionalForm[expr2 = Collect[expr, x^α, FullSimplify]]

enter image description here

If the intent is to display terms with the form x^(m*α + n)

TraditionalForm[expr3 = Collect[#, x, FullSimplify] & /@ expr2]

enter image description here

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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