### Related

##### expandwrt_factored

? expandwrt_factored;

Calculate

##### expandwrt_factored

? expandwrt_factored ;

Calculate

##### expandwrt_factored

? expandwrt_factored;

Calculate

##### expandwrt_factored

? expandwrt_factored ;

Calculate

### expandwrt_factored

Run Example
```(%i1)globalsolve: true;
(%o1)                                true
(%i2) realonly: true;
(%o2)                                true
(%i3) /* Standard (x,y)->
(r,theta) coordinate translation */x(t) := r(t) * cos(theta(t));
(%o3)                     x(t) := r(t) cos(theta(t))
(%i4) y(t) := r(t) * sin(theta(t));
(%o4)                     y(t) := r(t) sin(theta(t))
(%i5) /* Constant course assumption */declare (slope,constant);
(%o5)                                done
(%i6) declare (slope,real);
(%o6)                                done
(%i7) declare (yintercept,constant);
(%o7)                                done
(%i8) declare (yintercept, real);
(%o8)                                done
(%i9) y(t)=slope * x(t) + yintercept;
(%o9)     r(t) sin(theta(t)) = slope r(t) cos(theta(t)) + yintercept
(%i10) eq1: y(t)=slope * x(t) + yintercept;
(%o10)    r(t) sin(theta(t)) = slope r(t) cos(theta(t)) + yintercept
(%i11) /* Known & constant sound velocity */declare (soundvel,constant);
(%o11)                               done
(%i12) assume(soundvel>
0);
(%o12)                          [0 < soundvel]
(%i13) /* Known and constant base frequency */declare (basefrequency, constant);
(%o13)                               done
(%i14) assume(basefrequency>
0);
(%o14)                        [0 < basefrequency]
(%i15) /* f-- observed frequency. Standard doppler equation*/declare(f, real);
(%o15)                               done
(%i16) declare (f, posfun);
(%o16)                               done
(%i17) let (diff(r(t),t), (f(t)/basefrequency-1)*soundvel);
d                           f(t)
(%o17)            -- (r(t)) --> soundvel (------------- - 1)
dt                      basefrequency
(%i18) diff(r(t),t) = (f(t)/basefrequency-1)*soundvel;
d                         f(t)
(%o18)             -- (r(t)) = soundvel (------------- - 1)
dt                    basefrequency
(%i19) /* Differentiate eq1 and solve for r(t) */eq3: letsimp(solve([diff(y(t),t) = slope * diff(x(t),t)],r(t)));
(%o19) [r(t) =
slope soundvel cos(theta(t))
- -------------------------------------------------------------------
d                               d
slope sin(theta(t)) (-- (theta(t))) + cos(theta(t)) (-- (theta(t)))
dt                              dt
soundvel sin(theta(t))
+ -------------------------------------------------------------------
d                               d
slope sin(theta(t)) (-- (theta(t))) + cos(theta(t)) (-- (theta(t)))
dt                              dt
+ (slope soundvel f(t) cos(theta(t)))/(basefrequency slope sin(theta(t))
d                                             d
(-- (theta(t))) + basefrequency cos(theta(t)) (-- (theta(t))))
dt                                            dt
+ (- (soundvel f(t) sin(theta(t)))/(basefrequency slope sin(theta(t))
d                                             d
(-- (theta(t))) + basefrequency cos(theta(t)) (-- (theta(t)))))]
dt                                            dt
(%i20) /* Differentiate eq3 and solve for slope */eq4: letsimp(diff(eq3,t));
soundvel f(t)
(%o20) [- soundvel + ------------- =
basefrequency
d
soundvel cos(theta(t)) (-- (theta(t)))
dt
-------------------------------------------------------------------
d                               d
slope sin(theta(t)) (-- (theta(t))) + cos(theta(t)) (-- (theta(t)))
dt                              dt
d
slope soundvel sin(theta(t)) (-- (theta(t)))
dt
+ -------------------------------------------------------------------
d                               d
slope sin(theta(t)) (-- (theta(t))) + cos(theta(t)) (-- (theta(t)))
dt                              dt
d
+ (slope soundvel (-- (f(t))) cos(theta(t)))
dt
d
/(basefrequency slope sin(theta(t)) (-- (theta(t)))
dt
d
+ basefrequency cos(theta(t)) (-- (theta(t))))
dt
d
+ (- (soundvel (-- (f(t))) sin(theta(t)))
dt
d
/(basefrequency slope sin(theta(t)) (-- (theta(t)))
dt
d
+ basefrequency cos(theta(t)) (-- (theta(t)))))
dt
d
+ (- (soundvel f(t) cos(theta(t)) (-- (theta(t))))
dt
d
/(basefrequency slope sin(theta(t)) (-- (theta(t)))
dt
d
+ basefrequency cos(theta(t)) (-- (theta(t)))))
dt
d
+ (- (slope soundvel f(t) sin(theta(t)) (-- (theta(t))))
dt
d
/(basefrequency slope sin(theta(t)) (-- (theta(t)))
dt
d
+ basefrequency cos(theta(t)) (-- (theta(t)))))
dt
2
d
+ (slope soundvel cos(theta(t)) (slope sin(theta(t)) (--- (theta(t)))
2
dt
2
d                                d             2
+ cos(theta(t)) (--- (theta(t))) - sin(theta(t)) (-- (theta(t)))
2                              dt
dt
d             2
+ slope cos(theta(t)) (-- (theta(t))) ))
dt
d                               d              2
/(slope sin(theta(t)) (-- (theta(t))) + cos(theta(t)) (-- (theta(t))))
dt                              dt
2
d
+ (- (soundvel sin(theta(t)) (slope sin(theta(t)) (--- (theta(t)))
2
dt
2
d                                d             2
+ cos(theta(t)) (--- (theta(t))) - sin(theta(t)) (-- (theta(t)))
2                              dt
dt
d             2
+ slope cos(theta(t)) (-- (theta(t))) ))
dt
d                               d              2
/(slope sin(theta(t)) (-- (theta(t))) + cos(theta(t)) (-- (theta(t)))) )
dt                              dt
+ (- (slope soundvel f(t) cos(theta(t))
2
d
(basefrequency slope sin(theta(t)) (--- (theta(t)))
2
dt
2
d
+ basefrequency cos(theta(t)) (--- (theta(t)))
2
dt
d             2
- basefrequency sin(theta(t)) (-- (theta(t)))
dt
d             2
+ basefrequency slope cos(theta(t)) (-- (theta(t))) ))
dt
d
/expt(basefrequency slope sin(theta(t)) (-- (theta(t)))
dt
d
+ basefrequency cos(theta(t)) (-- (theta(t))), 2))
dt
+ (soundvel f(t) sin(theta(t)) (basefrequency slope sin(theta(t))
2                                              2
d                                              d
(--- (theta(t))) + basefrequency cos(theta(t)) (--- (theta(t)))
2                                              2
dt                                             dt
d             2
- basefrequency sin(theta(t)) (-- (theta(t)))
dt
d             2
+ basefrequency slope cos(theta(t)) (-- (theta(t))) ))
dt
d
/expt(basefrequency slope sin(theta(t)) (-- (theta(t)))
dt
d
+ basefrequency cos(theta(t)) (-- (theta(t))), 2)]
dt
(%i21) eq6: trigsimp(solve(eq4, slope));
2                                          2
(%o21) [slope = (sqrt((f (t) - 2 basefrequency f(t) + basefrequency )
2
d              2                               d           d
(--- (theta(t)))  + (2 basefrequency - 2 f(t)) (-- (f(t))) (-- (theta(t)))
2                                            dt          dt
dt
2
d                       2                                             2
(--- (theta(t))) + (- 8 f (t) + 16 basefrequency f(t) - 8 basefrequency )
2
dt
d             4    d         2  d             2
(-- (theta(t)))  + (-- (f(t)))  (-- (theta(t))) )
dt                 dt           dt
2
+ ((2 f(t) - 2 basefrequency) sin (theta(t)) - f(t) + basefrequency)
2
d
(--- (theta(t))) + (2 basefrequency - 2 f(t)) cos(theta(t)) sin(theta(t))
2
dt
d             2    d              d             2             d
(-- (theta(t)))  + (-- (f(t)) - 2 (-- (f(t))) sin (theta(t))) (-- (theta(t))))
dt                 dt             dt                          dt
2
d
/((2 f(t) - 2 basefrequency) cos(theta(t)) sin(theta(t)) (--- (theta(t)))
2
dt
2
+ ((2 f(t) - 2 basefrequency) sin (theta(t)) + 2 f(t) - 2 basefrequency)
d             2      d
(-- (theta(t)))  - 2 (-- (f(t))) cos(theta(t)) sin(theta(t))
dt                   dt
d                                  2
(-- (theta(t)))), slope = - (sqrt((f (t) - 2 basefrequency f(t)
dt
2
2   d              2                               d
+ basefrequency ) (--- (theta(t)))  + (2 basefrequency - 2 f(t)) (-- (f(t)))
2                                            dt
dt
2
d               d                       2
(-- (theta(t))) (--- (theta(t))) + (- 8 f (t) + 16 basefrequency f(t)
dt                2
dt
2   d             4    d         2  d             2
- 8 basefrequency ) (-- (theta(t)))  + (-- (f(t)))  (-- (theta(t))) )
dt                 dt           dt
2
+ ((2 f(t) - 2 basefrequency) cos (theta(t)) - f(t) + basefrequency)
2
d
(--- (theta(t))) + (2 f(t) - 2 basefrequency) cos(theta(t)) sin(theta(t))
2
dt
d             2    d              d             2             d
(-- (theta(t)))  + (-- (f(t)) - 2 (-- (f(t))) cos (theta(t))) (-- (theta(t))))
dt                 dt             dt                          dt
2
d
/((2 f(t) - 2 basefrequency) cos(theta(t)) sin(theta(t)) (--- (theta(t)))
2
dt
2
+ ((2 basefrequency - 2 f(t)) cos (theta(t)) + 4 f(t) - 4 basefrequency)
d             2      d                                       d
(-- (theta(t)))  - 2 (-- (f(t))) cos(theta(t)) sin(theta(t)) (-- (theta(t))))]
dt                   dt                                      dt
(%i22) /* Now we have a number of estimates for the slope constant. *//* We can use any statistical technique to estimate the actual constant *//* Constant speed assumption */eq7: letsimp(diff(letsimp(diff(x(t),t)),t)) = 0;
2
d
(%o22) (- basefrequency r(t) sin(theta(t)) (--- (theta(t)))
2
dt
d             2
- basefrequency r(t) cos(theta(t)) (-- (theta(t)))
dt
d
- 2 soundvel f(t) sin(theta(t)) (-- (theta(t)))
dt
d
+ 2 basefrequency soundvel sin(theta(t)) (-- (theta(t)))
dt
d
+ soundvel (-- (f(t))) cos(theta(t)))/basefrequency = 0
dt
(%i23) eq8: solve(eq7, r(t));
(%o23) [r(t) = - ((2 soundvel f(t) - 2 basefrequency soundvel) sin(theta(t))
d                          d
(-- (theta(t))) - soundvel (-- (f(t))) cos(theta(t)))
dt                         dt
2
d
/(basefrequency sin(theta(t)) (--- (theta(t)))
2
dt
d             2
+ basefrequency cos(theta(t)) (-- (theta(t))) )]
dt
(%i24) eq9: subst(eq8, eq1);
(%o24) - (sin(theta(t)) ((2 soundvel f(t) - 2 basefrequency soundvel)
d                          d
sin(theta(t)) (-- (theta(t))) - soundvel (-- (f(t))) cos(theta(t))))
dt                         dt
2
d
/(basefrequency sin(theta(t)) (--- (theta(t)))
2
dt
d             2
+ basefrequency cos(theta(t)) (-- (theta(t))) ) =
dt
yintercept - (slope cos(theta(t)) ((2 soundvel f(t) - 2 basefrequency soundvel)
d                          d
sin(theta(t)) (-- (theta(t))) - soundvel (-- (f(t))) cos(theta(t))))
dt                         dt
2
d
/(basefrequency sin(theta(t)) (--- (theta(t)))
2
dt
d             2
+ basefrequency cos(theta(t)) (-- (theta(t))) )
dt
(%i25) eq10: solve(eq9, yintercept);
(%o25) [yintercept = - (((2 soundvel f(t) - 2 basefrequency soundvel)
2
sin (theta(t)) + (2 basefrequency slope soundvel - 2 slope soundvel f(t))
d
cos(theta(t)) sin(theta(t))) (-- (theta(t)))
dt
d
- soundvel (-- (f(t))) cos(theta(t)) sin(theta(t))
dt
d             2
+ slope soundvel (-- (f(t))) cos (theta(t)))
dt
2
d
/(basefrequency sin(theta(t)) (--- (theta(t)))
2
dt
d             2
+ basefrequency cos(theta(t)) (-- (theta(t))) )]
dt
(%i26) /* Now we have a number of estimates for the yintercept constant. *//* We can use any statistical technique to estimate the actual constant *//* This gives us r(theta) in terms of slope and y_intercept*/eq_rt: solve(eq1, r(t));
yintercept
(%o26)           [r(t) = -----------------------------------]
sin(theta(t)) - slope cos(theta(t))
(%i27) tlimswitch: true;
(%o27)                               true
(%i28) eq11: expandwrt_factored (eq6, basefrequency);
2
2     d              2
(%o28) [slope = (sqrt(f (t) (--- (theta(t)))
2
dt
2                                  2
d              2                2  d              2
- 2 basefrequency f(t) (--- (theta(t)))  + basefrequency  (--- (theta(t)))
2                                  2
dt                                 dt
2
d           d               d
- 2 f(t) (-- (f(t))) (-- (theta(t))) (--- (theta(t)))
dt          dt                2
dt
2
d           d               d
+ 2 basefrequency (-- (f(t))) (-- (theta(t))) (--- (theta(t)))
dt          dt                2
dt
2     d             4                          d             4
- 8 f (t) (-- (theta(t)))  + 16 basefrequency f(t) (-- (theta(t)))
dt                                       dt
2  d             4    d         2  d             2
- 8 basefrequency  (-- (theta(t)))  + (-- (f(t)))  (-- (theta(t))) )
dt                 dt           dt
2
+ ((2 f(t) - 2 basefrequency) sin (theta(t)) - f(t) + basefrequency)
2
d
(--- (theta(t))) + (2 basefrequency - 2 f(t)) cos(theta(t)) sin(theta(t))
2
dt
d             2    d              d             2             d
(-- (theta(t)))  + (-- (f(t)) - 2 (-- (f(t))) sin (theta(t))) (-- (theta(t))))
dt                 dt             dt                          dt
2
d
/((2 f(t) - 2 basefrequency) cos(theta(t)) sin(theta(t)) (--- (theta(t)))
2
dt
2
+ ((2 f(t) - 2 basefrequency) sin (theta(t)) + 2 f(t) - 2 basefrequency)
d             2      d
(-- (theta(t)))  - 2 (-- (f(t))) cos(theta(t)) sin(theta(t))
dt                   dt
2
d                                 2     d              2
(-- (theta(t)))), slope = - (sqrt(f (t) (--- (theta(t)))
dt                                        2
dt
2                                  2
d              2                2  d              2
- 2 basefrequency f(t) (--- (theta(t)))  + basefrequency  (--- (theta(t)))
2                                  2
dt                                 dt
2
d           d               d
- 2 f(t) (-- (f(t))) (-- (theta(t))) (--- (theta(t)))
dt          dt                2
dt
2
d           d               d
+ 2 basefrequency (-- (f(t))) (-- (theta(t))) (--- (theta(t)))
dt          dt                2
dt
2     d             4                          d             4
- 8 f (t) (-- (theta(t)))  + 16 basefrequency f(t) (-- (theta(t)))
dt                                       dt
2  d             4    d         2  d             2
- 8 basefrequency  (-- (theta(t)))  + (-- (f(t)))  (-- (theta(t))) )
dt                 dt           dt
2
+ ((2 f(t) - 2 basefrequency) cos (theta(t)) - f(t) + basefrequency)
2
d
(--- (theta(t))) + (2 f(t) - 2 basefrequency) cos(theta(t)) sin(theta(t))
2
dt
d             2    d              d             2             d
(-- (theta(t)))  + (-- (f(t)) - 2 (-- (f(t))) cos (theta(t))) (-- (theta(t))))
dt                 dt             dt                          dt
2
d
/((2 f(t) - 2 basefrequency) cos(theta(t)) sin(theta(t)) (--- (theta(t)))
2
dt
2
+ ((2 basefrequency - 2 f(t)) cos (theta(t)) + 4 f(t) - 4 basefrequency)
d             2      d                                       d
(-- (theta(t)))  - 2 (-- (f(t))) cos(theta(t)) sin(theta(t)) (-- (theta(t))))]
dt                   dt                                      dt
(%i29) ratcoef(eq11, basefrequency, 2);
(%o29)                          [0 = 0, 0 = 0]
(%i30) ratcoef(eq11, basefrequency, 1);
(%o30)                          [0 = 0, 0 = 0]
(%i31) ratcoef(eq11, basefrequency, 0);
2
2                 d
(%o31) [slope = ((2 sin (theta(t)) - 1) (--- (theta(t)))
2
dt
d             2
- 2 cos(theta(t)) sin(theta(t)) (-- (theta(t))) )
dt
2
d
/(2 cos(theta(t)) sin(theta(t)) (--- (theta(t)))
2
dt
2                 d             2
+ (2 sin (theta(t)) + 2) (-- (theta(t))) ),
dt
2
2                 d
slope = - ((2 cos (theta(t)) - 1) (--- (theta(t)))
2
dt
d             2
+ 2 cos(theta(t)) sin(theta(t)) (-- (theta(t))) )
dt
2
d
/(2 cos(theta(t)) sin(theta(t)) (--- (theta(t)))
2
dt
2             d             2
+ (4 - 2 cos (theta(t))) (-- (theta(t))) )]
dt
(%i32) eq12: solve([eq4, slope=0], basefrequency);
(%o32)                                []
(%i33) ```
Run Example
```xp:x-v*t;
(%o1)                               x - t v
(%i2) wp:a1*w+a2*t+a3*x;
(%o2)                         a3 x + a1 w + a2 t
(%i3) tp:g*t+g1*x+g2*w;
(%o3)                          g1 x + g2 w + g t
(%i4) ex:xp^2-c^2*tp^2+a^2*wp^2;
2                    2    2                     2            2
(%o4)  - c  (g1 x + g2 w + g t)  + a  (a3 x + a1 w + a2 t)  + (x - t v)
(%i5) expand(ex);
2   2  2    2   2  2    2      2                2
(%o5) - c  g1  x  + a  a3  x  + x  - 2 c  g1 g2 w x + 2 a  a1 a3 w x - 2 t v x
2               2              2   2  2    2   2  2      2
- 2 c  g g1 t x + 2 a  a2 a3 t x - c  g2  w  + a  a1  w  - 2 c  g g2 t w
2              2  2    2  2  2    2   2  2
+ 2 a  a1 a2 t w + t  v  - c  g  t  + a  a2  t
(%i6) expandwrt_factored(ex, x);
2   2  2    2   2  2    2      2
(%o6) - c  g1  x  + a  a3  x  + x  - 2 c  g1 (g2 w + g t) x
2                                 2             2    2              2
+ 2 a  a3 (a1 w + a2 t) x - 2 t v x - c  (g2 w + g t)  + a  (a1 w + a2 t)
2  2
+ t  v
(%i7) ```
Run Example
```globalsolve: true;
(%o1)                                true
(%i2) realonly: true;
(%o2)                                true
(%i3) /* Standard (x,y)->
(r,theta) coordinate translation */x(t) := r(t) * cos(theta(t));
(%o3)                     x(t) := r(t) cos(theta(t))
(%i4) y(t) := r(t) * sin(theta(t));
(%o4)                     y(t) := r(t) sin(theta(t))
(%i5) /* Constant course assumption */declare (slope,constant);
(%o5)                                done
(%i6) declare (slope,real);
(%o6)                                done
(%i7) declare (yintercept,constant);
(%o7)                                done
(%i8) declare (yintercept, real);
(%o8)                                done
(%i9) y(t)=slope * x(t) + yintercept;
(%o9)     r(t) sin(theta(t)) = slope r(t) cos(theta(t)) + yintercept
(%i10) eq1: y(t)=slope * x(t) + yintercept;
(%o10)    r(t) sin(theta(t)) = slope r(t) cos(theta(t)) + yintercept
(%i11) /* Known & constant sound velocity */declare (soundvel,constant);
(%o11)                               done
(%i12) assume(soundvel>
0);
(%o12)                          [0 < soundvel]
(%i13) /* Known and constant base frequency */declare (basefrequency, constant);
(%o13)                               done
(%i14) assume(basefrequency>
0);
(%o14)                        [0 < basefrequency]
(%i15) /* f-- observed frequency. Standard doppler equation*/declare(f, real);
(%o15)                               done
(%i16) let (diff(r(t),t), (f(t)/basefrequency-1)*soundvel);
d                           f(t)
(%o16)            -- (r(t)) --> soundvel (------------- - 1)
dt                      basefrequency
(%i17) diff(r(t),t) = (f(t)/basefrequency-1)*soundvel;
d                         f(t)
(%o17)             -- (r(t)) = soundvel (------------- - 1)
dt                    basefrequency
(%i18) /* Differentiate eq1 and solve for r(t) */eq3: letsimp(solve([diff(y(t),t) = slope * diff(x(t),t)],r(t)));
(%o18) [r(t) =
slope soundvel cos(theta(t))
- -------------------------------------------------------------------
d                               d
slope sin(theta(t)) (-- (theta(t))) + cos(theta(t)) (-- (theta(t)))
dt                              dt
soundvel sin(theta(t))
+ -------------------------------------------------------------------
d                               d
slope sin(theta(t)) (-- (theta(t))) + cos(theta(t)) (-- (theta(t)))
dt                              dt
+ (slope soundvel f(t) cos(theta(t)))/(basefrequency slope sin(theta(t))
d                                             d
(-- (theta(t))) + basefrequency cos(theta(t)) (-- (theta(t))))
dt                                            dt
+ (- (soundvel f(t) sin(theta(t)))/(basefrequency slope sin(theta(t))
d                                             d
(-- (theta(t))) + basefrequency cos(theta(t)) (-- (theta(t)))))]
dt                                            dt
(%i19) /* Differentiate eq3 and solve for slope */eq4: letsimp(diff(eq3,t));
soundvel f(t)
(%o19) [- soundvel + ------------- =
basefrequency
d
soundvel cos(theta(t)) (-- (theta(t)))
dt
-------------------------------------------------------------------
d                               d
slope sin(theta(t)) (-- (theta(t))) + cos(theta(t)) (-- (theta(t)))
dt                              dt
d
slope soundvel sin(theta(t)) (-- (theta(t)))
dt
+ -------------------------------------------------------------------
d                               d
slope sin(theta(t)) (-- (theta(t))) + cos(theta(t)) (-- (theta(t)))
dt                              dt
d
+ (slope soundvel (-- (f(t))) cos(theta(t)))
dt
d
/(basefrequency slope sin(theta(t)) (-- (theta(t)))
dt
d
+ basefrequency cos(theta(t)) (-- (theta(t))))
dt
d
+ (- (soundvel (-- (f(t))) sin(theta(t)))
dt
d
/(basefrequency slope sin(theta(t)) (-- (theta(t)))
dt
d
+ basefrequency cos(theta(t)) (-- (theta(t)))))
dt
d
+ (- (soundvel f(t) cos(theta(t)) (-- (theta(t))))
dt
d
/(basefrequency slope sin(theta(t)) (-- (theta(t)))
dt
d
+ basefrequency cos(theta(t)) (-- (theta(t)))))
dt
d
+ (- (slope soundvel f(t) sin(theta(t)) (-- (theta(t))))
dt
d
/(basefrequency slope sin(theta(t)) (-- (theta(t)))
dt
d
+ basefrequency cos(theta(t)) (-- (theta(t)))))
dt
2
d
+ (slope soundvel cos(theta(t)) (slope sin(theta(t)) (--- (theta(t)))
2
dt
2
d                                d             2
+ cos(theta(t)) (--- (theta(t))) - sin(theta(t)) (-- (theta(t)))
2                              dt
dt
d             2
+ slope cos(theta(t)) (-- (theta(t))) ))
dt
d                               d              2
/(slope sin(theta(t)) (-- (theta(t))) + cos(theta(t)) (-- (theta(t))))
dt                              dt
2
d
+ (- (soundvel sin(theta(t)) (slope sin(theta(t)) (--- (theta(t)))
2
dt
2
d                                d             2
+ cos(theta(t)) (--- (theta(t))) - sin(theta(t)) (-- (theta(t)))
2                              dt
dt
d             2
+ slope cos(theta(t)) (-- (theta(t))) ))
dt
d                               d              2
/(slope sin(theta(t)) (-- (theta(t))) + cos(theta(t)) (-- (theta(t)))) )
dt                              dt
+ (- (slope soundvel f(t) cos(theta(t))
2
d
(basefrequency slope sin(theta(t)) (--- (theta(t)))
2
dt
2
d
+ basefrequency cos(theta(t)) (--- (theta(t)))
2
dt
d             2
- basefrequency sin(theta(t)) (-- (theta(t)))
dt
d             2
+ basefrequency slope cos(theta(t)) (-- (theta(t))) ))
dt
d
/expt(basefrequency slope sin(theta(t)) (-- (theta(t)))
dt
d
+ basefrequency cos(theta(t)) (-- (theta(t))), 2))
dt
+ (soundvel f(t) sin(theta(t)) (basefrequency slope sin(theta(t))
2                                              2
d                                              d
(--- (theta(t))) + basefrequency cos(theta(t)) (--- (theta(t)))
2                                              2
dt                                             dt
d             2
- basefrequency sin(theta(t)) (-- (theta(t)))
dt
d             2
+ basefrequency slope cos(theta(t)) (-- (theta(t))) ))
dt
d
/expt(basefrequency slope sin(theta(t)) (-- (theta(t)))
dt
d
+ basefrequency cos(theta(t)) (-- (theta(t))), 2)]
dt
(%i20) eq6: trigsimp(solve(eq4, slope));
2                                          2
(%o20) [slope = (sqrt((f (t) - 2 basefrequency f(t) + basefrequency )
2
d              2                               d           d
(--- (theta(t)))  + (2 basefrequency - 2 f(t)) (-- (f(t))) (-- (theta(t)))
2                                            dt          dt
dt
2
d                       2                                             2
(--- (theta(t))) + (- 8 f (t) + 16 basefrequency f(t) - 8 basefrequency )
2
dt
d             4    d         2  d             2
(-- (theta(t)))  + (-- (f(t)))  (-- (theta(t))) )
dt                 dt           dt
2
+ ((2 f(t) - 2 basefrequency) sin (theta(t)) - f(t) + basefrequency)
2
d
(--- (theta(t))) + (2 basefrequency - 2 f(t)) cos(theta(t)) sin(theta(t))
2
dt
d             2    d              d             2             d
(-- (theta(t)))  + (-- (f(t)) - 2 (-- (f(t))) sin (theta(t))) (-- (theta(t))))
dt                 dt             dt                          dt
2
d
/((2 f(t) - 2 basefrequency) cos(theta(t)) sin(theta(t)) (--- (theta(t)))
2
dt
2
+ ((2 f(t) - 2 basefrequency) sin (theta(t)) + 2 f(t) - 2 basefrequency)
d             2      d
(-- (theta(t)))  - 2 (-- (f(t))) cos(theta(t)) sin(theta(t))
dt                   dt
d                                  2
(-- (theta(t)))), slope = - (sqrt((f (t) - 2 basefrequency f(t)
dt
2
2   d              2                               d
+ basefrequency ) (--- (theta(t)))  + (2 basefrequency - 2 f(t)) (-- (f(t)))
2                                            dt
dt
2
d               d                       2
(-- (theta(t))) (--- (theta(t))) + (- 8 f (t) + 16 basefrequency f(t)
dt                2
dt
2   d             4    d         2  d             2
- 8 basefrequency ) (-- (theta(t)))  + (-- (f(t)))  (-- (theta(t))) )
dt                 dt           dt
2
+ ((2 f(t) - 2 basefrequency) cos (theta(t)) - f(t) + basefrequency)
2
d
(--- (theta(t))) + (2 f(t) - 2 basefrequency) cos(theta(t)) sin(theta(t))
2
dt
d             2    d              d             2             d
(-- (theta(t)))  + (-- (f(t)) - 2 (-- (f(t))) cos (theta(t))) (-- (theta(t))))
dt                 dt             dt                          dt
2
d
/((2 f(t) - 2 basefrequency) cos(theta(t)) sin(theta(t)) (--- (theta(t)))
2
dt
2
+ ((2 basefrequency - 2 f(t)) cos (theta(t)) + 4 f(t) - 4 basefrequency)
d             2      d                                       d
(-- (theta(t)))  - 2 (-- (f(t))) cos(theta(t)) sin(theta(t)) (-- (theta(t))))]
dt                   dt                                      dt
(%i21) /* Now we have a number of estimates for the slope constant. *//* We can use any statistical technique to estimate the actual constant *//* Constant speed assumption */eq7: letsimp(diff(letsimp(diff(x(t),t)),t)) = 0;
2
d
(%o21) (- basefrequency r(t) sin(theta(t)) (--- (theta(t)))
2
dt
d             2
- basefrequency r(t) cos(theta(t)) (-- (theta(t)))
dt
d
- 2 soundvel f(t) sin(theta(t)) (-- (theta(t)))
dt
d
+ 2 basefrequency soundvel sin(theta(t)) (-- (theta(t)))
dt
d
+ soundvel (-- (f(t))) cos(theta(t)))/basefrequency = 0
dt
(%i22) eq8: solve(eq7, r(t));
(%o22) [r(t) = - ((2 soundvel f(t) - 2 basefrequency soundvel) sin(theta(t))
d                          d
(-- (theta(t))) - soundvel (-- (f(t))) cos(theta(t)))
dt                         dt
2
d
/(basefrequency sin(theta(t)) (--- (theta(t)))
2
dt
d             2
+ basefrequency cos(theta(t)) (-- (theta(t))) )]
dt
(%i23) eq9: subst(eq8, eq1);
(%o23) - (sin(theta(t)) ((2 soundvel f(t) - 2 basefrequency soundvel)
d                          d
sin(theta(t)) (-- (theta(t))) - soundvel (-- (f(t))) cos(theta(t))))
dt                         dt
2
d
/(basefrequency sin(theta(t)) (--- (theta(t)))
2
dt
d             2
+ basefrequency cos(theta(t)) (-- (theta(t))) ) =
dt
yintercept - (slope cos(theta(t)) ((2 soundvel f(t) - 2 basefrequency soundvel)
d                          d
sin(theta(t)) (-- (theta(t))) - soundvel (-- (f(t))) cos(theta(t))))
dt                         dt
2
d
/(basefrequency sin(theta(t)) (--- (theta(t)))
2
dt
d             2
+ basefrequency cos(theta(t)) (-- (theta(t))) )
dt
(%i24) eq10: solve(eq9, yintercept);
(%o24) [yintercept = - (((2 soundvel f(t) - 2 basefrequency soundvel)
2
sin (theta(t)) + (2 basefrequency slope soundvel - 2 slope soundvel f(t))
d
cos(theta(t)) sin(theta(t))) (-- (theta(t)))
dt
d
- soundvel (-- (f(t))) cos(theta(t)) sin(theta(t))
dt
d             2
+ slope soundvel (-- (f(t))) cos (theta(t)))
dt
2
d
/(basefrequency sin(theta(t)) (--- (theta(t)))
2
dt
d             2
+ basefrequency cos(theta(t)) (-- (theta(t))) )]
dt
(%i25) /* Now we have a number of estimates for the yintercept constant. *//* We can use any statistical technique to estimate the actual constant *//* This gives us r(theta) in terms of slope and y_intercept*/eq_rt: solve(eq1, r(t));
yintercept
(%o25)           [r(t) = -----------------------------------]
sin(theta(t)) - slope cos(theta(t))
(%i26) tlimswitch: true;
(%o26)                               true
(%i27) eq11: expandwrt_factored (eq6, basefrequency);
2
2     d              2
(%o27) [slope = (sqrt(f (t) (--- (theta(t)))
2
dt
2                                  2
d              2                2  d              2
- 2 basefrequency f(t) (--- (theta(t)))  + basefrequency  (--- (theta(t)))
2                                  2
dt                                 dt
2
d           d               d
- 2 f(t) (-- (f(t))) (-- (theta(t))) (--- (theta(t)))
dt          dt                2
dt
2
d           d               d
+ 2 basefrequency (-- (f(t))) (-- (theta(t))) (--- (theta(t)))
dt          dt                2
dt
2     d             4                          d             4
- 8 f (t) (-- (theta(t)))  + 16 basefrequency f(t) (-- (theta(t)))
dt                                       dt
2  d             4    d         2  d             2
- 8 basefrequency  (-- (theta(t)))  + (-- (f(t)))  (-- (theta(t))) )
dt                 dt           dt
2
+ ((2 f(t) - 2 basefrequency) sin (theta(t)) - f(t) + basefrequency)
2
d
(--- (theta(t))) + (2 basefrequency - 2 f(t)) cos(theta(t)) sin(theta(t))
2
dt
d             2    d              d             2             d
(-- (theta(t)))  + (-- (f(t)) - 2 (-- (f(t))) sin (theta(t))) (-- (theta(t))))
dt                 dt             dt                          dt
2
d
/((2 f(t) - 2 basefrequency) cos(theta(t)) sin(theta(t)) (--- (theta(t)))
2
dt
2
+ ((2 f(t) - 2 basefrequency) sin (theta(t)) + 2 f(t) - 2 basefrequency)
d             2      d
(-- (theta(t)))  - 2 (-- (f(t))) cos(theta(t)) sin(theta(t))
dt                   dt
2
d                                 2     d              2
(-- (theta(t)))), slope = - (sqrt(f (t) (--- (theta(t)))
dt                                        2
dt
2                                  2
d              2                2  d              2
- 2 basefrequency f(t) (--- (theta(t)))  + basefrequency  (--- (theta(t)))
2                                  2
dt                                 dt
2
d           d               d
- 2 f(t) (-- (f(t))) (-- (theta(t))) (--- (theta(t)))
dt          dt                2
dt
2
d           d               d
+ 2 basefrequency (-- (f(t))) (-- (theta(t))) (--- (theta(t)))
dt          dt                2
dt
2     d             4                          d             4
- 8 f (t) (-- (theta(t)))  + 16 basefrequency f(t) (-- (theta(t)))
dt                                       dt
2  d             4    d         2  d             2
- 8 basefrequency  (-- (theta(t)))  + (-- (f(t)))  (-- (theta(t))) )
dt                 dt           dt
2
+ ((2 f(t) - 2 basefrequency) cos (theta(t)) - f(t) + basefrequency)
2
d
(--- (theta(t))) + (2 f(t) - 2 basefrequency) cos(theta(t)) sin(theta(t))
2
dt
d             2    d              d             2             d
(-- (theta(t)))  + (-- (f(t)) - 2 (-- (f(t))) cos (theta(t))) (-- (theta(t))))
dt                 dt             dt                          dt
2
d
/((2 f(t) - 2 basefrequency) cos(theta(t)) sin(theta(t)) (--- (theta(t)))
2
dt
2
+ ((2 basefrequency - 2 f(t)) cos (theta(t)) + 4 f(t) - 4 basefrequency)
d             2      d                                       d
(-- (theta(t)))  - 2 (-- (f(t))) cos(theta(t)) sin(theta(t)) (-- (theta(t))))]
dt                   dt                                      dt
(%i28) ratcoef(eq11, basefrequency, 2);
(%o28)                          [0 = 0, 0 = 0]
(%i29) ratcoef(eq11, basefrequency, 1);
(%o29)                          [0 = 0, 0 = 0]
(%i30) ratcoef(eq11, basefrequency, 0);
2
2                 d
(%o30) [slope = ((2 sin (theta(t)) - 1) (--- (theta(t)))
2
dt
d             2
- 2 cos(theta(t)) sin(theta(t)) (-- (theta(t))) )
dt
2
d
/(2 cos(theta(t)) sin(theta(t)) (--- (theta(t)))
2
dt
2                 d             2
+ (2 sin (theta(t)) + 2) (-- (theta(t))) ),
dt
2
2                 d
slope = - ((2 cos (theta(t)) - 1) (--- (theta(t)))
2
dt
d             2
+ 2 cos(theta(t)) sin(theta(t)) (-- (theta(t))) )
dt
2
d
/(2 cos(theta(t)) sin(theta(t)) (--- (theta(t)))
2
dt
2             d             2
+ (4 - 2 cos (theta(t))) (-- (theta(t))) )]
dt
(%i31) ```

### Related Help

Help for Expandwrt_factored