0
$\begingroup$

I have the expression

1 + Exp[-2 x] (-1 - 2 x (1 + x))

I used Expand to get the x's to multiply within the parentheses, this gives

1 - Exp[-2 x] - 2 Exp[-2 x] x - 2 Exp[-2 x] x^2

I'm expected to get this into the form

1 - Exp[-2 x]*(1 + 2 x + 2 x^2)

I would expect

Collect[1 - Exp[-2 x] - 2 Exp[-2 x] x - 2 Exp[-2 x] x^2, -Exp[-2x]]

to do this but it only returns the expanded form again.

$\endgroup$
0

1 Answer 1

0
$\begingroup$

Collect[..., -Exp[-2x]] isn't working because some of the terms are -2Exp[-2x] and this doesn't match. If you use Simplify[Collect[Expand[1+Exp[-2x](-1-2x(1+x))], Exp[-2x]]], you should get it in the format you're looking for.

$\endgroup$
2
  • $\begingroup$ i feel dumb, maybe a nap is in order before i continue to make such silly mistakes. Thanks for your time. $\endgroup$
    – Kraft Punk
    Commented Oct 6, 2019 at 18:33
  • 2
    $\begingroup$ @KraftPunk I don't think it's a dumb mistake. To a human, it's obvious that we should be able to factor out -Exp[-2x], but sometimes we have to find workarounds when it comes to computers. $\endgroup$
    – MassDefect
    Commented Oct 6, 2019 at 19:36

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.