### Related

##### bothcoef-coeff-rhs

rhs(coeff(y-10*x-40=0));

bothcoef(y-10*x-40,x);

Calculate

##### bothcoef-expand

bothcoef(expand( (B-2...

Calculate

##### bothcoef

bothcoef(3*v^2*w^3*x^...

Calculate

##### bothcoef-expand-subst

expr: z^3 + a1*z*w + ...

expr : subst (expr,z,...

bothcoef (expand (exp...

Calculate

##### bothcoef-subst

expr: z^3 + a1*z*w + ...

bothcoef (subst (expr...

Calculate

##### bothcoef-coeff-rhs

rhs(coeff(y-10*x-40=0));

bothcoef(y=10*x-40,x);

Calculate

##### bothcoef-coeff-rhs

rhs(coeff(y-10*x-40=0));

bothcoef(y-10*x-40,x);

Calculate

##### bothcoef-expand-subst

expr: z^3 + a1*z*w + ...

bothcoef (expand(subs...

Calculate

##### bothcoef-expand-subst

expr: z^3 + a1*z*w + ...

bothcoef (expand(subs...

Calculate

##### bothcoef-expand-subst

expr: z^3 + a1*z*w + ...

bothcoef (expand(subs...

Calculate

### bothcoef

Run Example
```(%i1)? bothcoef;

-- Function: bothcoef (<expr>, <x>)
Returns a list whose first member is the coefficient of <x> in
<expr> (as found by `ratcoef' if <expr> is in CRE form otherwise
by `coeff') and whose second member is the remaining part of
<expr>.  That is, `[A, B]' where `<expr> = A*<x> + B'.

Example:

(%i1) islinear (expr, x) := block ([c],
c: bothcoef (rat (expr, x), x),
is (freeof (x, c) and c[1] # 0))\$
(%i2) islinear ((r^2 - (x - r)^2)/x, x);
(%o2)                         true

(%o1)                                true
(%i2) ```
Run Example
```bothcoef(expand( (B-2*b*x+x^2)^2 * (C-2*c*x+x^2) * (D - 2*d*x + x^2)),x);
2          2
(%o1) [- 4 b B C D - 2 c B  D - 2 d B  C,
2          2       2          2
- x (- 4 b B C D - 2 c B  D - 2 d B  C) + B  C D + 2 x  B C D - 4 b x B C D
4            3          2  2        2  2            2        4
+ x  C D - 4 b x  C D + 4 b  x  C D + x  B  D - 2 c x B  D + 2 x  B D
3            3              2        6          5          5
- 4 c x  B D - 4 b x  B D + 8 b c x  B D + x  D - 2 c x  D - 4 b x  D
4        2  4        2    3      2  2            2        4
+ 8 b c x  D + 4 b  x  D - 8 b  c x  D + x  B  C - 2 d x B  C + 2 x  B C
3            3              2        6          5          5
- 4 d x  B C - 4 b x  B C + 8 b d x  B C + x  C - 2 d x  C - 4 b x  C
4        2  4        2    3      4  2        3  2        3  2
+ 8 b d x  C + 4 b  x  C - 8 b  d x  C + x  B  - 2 d x  B  - 2 c x  B
2  2      6          5          5          5            4
+ 4 c d x  B  + 2 x  B - 4 d x  B - 4 c x  B - 4 b x  B + 8 c d x  B
4            4               3      8        7        7        7
+ 8 b d x  B + 8 b c x  B - 16 b c d x  B + x  - 2 d x  - 2 c x  - 4 b x
6          6          6      2  6             5      2    5
+ 4 c d x  + 8 b d x  + 8 b c x  + 4 b  x  - 16 b c d x  - 8 b  d x
2    5       2      4
- 8 b  c x  + 16 b  c d x ]
(%i2) ```
Run Example
```bothcoef(3*v^2*w^3*x^4+1, v);
2  3  4
(%o1)                         [0, 3 v  w  x  + 1]
(%i2) ```

### Related Help

Help for Bothcoef