Simplify an expression

251 Views Asked by At

I'm a maple newbie and I would like to simplify this expression as much as i can:

$$g(q) = -8 \cdot 2^q + 8 \cdot 2^{\frac{3}{2}q} + 1$$

In such case i would like to write the expression like:

$$g(q) = -2^{q+3} + 2^{\frac{3}{2}q + 3} + 1 \;\;\;\; (1)$$

and then factorize $2^q$ in order to have:

$$g(q) = 2^{q+3}(2^{\frac{q}{2}} - 1) + 1 \;\;\;\; (2)$$

Is it possible to have at least the expression (1)? What about the (2)? assume the original one is given, $q$ is an integer positive variable, even (i don't think such detail is particularly useful).

I tried, factor, collect, simplify etc...

2

There are 2 best solutions below

2
On

HINT:

Use the following factorization:
$$8=2^3$$

1
On

Maple has trouble recognizing a number as anything but exactly that: $2^3$ is just the number $8$ to Maple, not the other way around. You can work around this, however, with the following substitutions,

g:=q->-8*2^(q)+8*2^(3/2*q)+1;

subs(8=2^x, -8=-2^x, g(q));
simplify(%);
subs(x = 3, %);

This gives you (1), however this is one of those cases where the computer program does not recognize things as well as you do. I think you need to motivate why you wish to get something like (2) - if you are looking to check your own solution for root finding, you could use the is command

is(g(q) = 2^(q+3)*(2^(q/2)-1)+1); # is g(q) equal to (2)

otherwise, for root finding, solve should work just fine.