Exercise 17

We first define the functions that are involved:

xx[t_, 0] = 1; 


    xx[t_, k_] := (((Cos[t]))^k);

    

    yy[t_, 0] = 1; 


    yy[t_, k_] := Cos[k t];

It is convenient to place all six functions in onel list:

Clear[XX];  XX[t_] := Table[xx[t, k], {k, 0, 5}]

Similarly for y-s.

Clear[YY];  YY[t_] := Table[yy[t, k], {k, 0, 5}]

Each y function can be expressed as a linear combination of  x functions. You should be able to do this by hand. Here is how to do this in Mathematica:

Clearly (notice the double equality sign asking: are they equal?)

yy[t, 0] == xx[t, 0]

yy[t, 1] == xx[t, 1]

Coordinates of  (Subscript[y, 2])(x) in terms of the functions x

TrigExpand[yy[t, 2]]

By hand I substitute:

Expand[Cos[t]^2 - (1 - Cos[t]^2)]

Hence

Simplify[yy[t, 2] == {-1, 0, 2, 0, 0, 0} . XX[t]]

Coordinates of  (Subscript[y, 3])(x) in terms of the functions x

TrigExpand[yy[t, 3]]

By hand I substitute:

Expand[Cos[t]^3 - 3 Cos[t] (1 - Cos[t]^2)]

Hence

Simplify[yy[t, 3] == {0, -3, 0, 4, 0, 0} . XX[t]]

Coordinates of  (Subscript[y, 4])(x) in terms of the functions x

TrigExpand[yy[t, 4]]

By hand I substitute:

Expand[
      Cos[t]^4 - 
        6 Cos[t]^2 (1 - 
              Cos[t]^2) + (((1 - Cos[t]^2))^2) ]

Hence

Simplify[yy[t, 4] == {1, 0, -8, 0, 8, 0} . XX[t]]

Coordinates of  (Subscript[y, 5])(x) in terms of the functions x

TrigExpand[yy[t, 5]]

By hand I substitute:

Expand[
      Cos[t]^5 - 10 Cos[t]^3 (1 - Cos[t]^2) + 
        5 Cos[t]  (((1 - Cos[t]^2))^2)]

Hence

Simplify[
      yy[t, 5] == {0, 5, 0, -20, 0, 16} . XX[t]]

Change of coordinate matrix

The following matrix changes coordinates in the basis with y functions into coordinates

mM = 
      Transpose[{{1, 0, 0, 0, 0, 0}, {0, 1, 0, 0, 0, 0}, {-1, 0, 2, 0, 0, 
            0}, {0, -3, 0, 4, 0, 0}, {1, 0, -8, 0, 8, 0}, {0, 5, 
            0, -20, 0, 16}}]

MatrixForm[mM]

Inverse[mM]

Transpose[mM][[6]]

Transpose[mM][[6]] . XX[t]

The following table of grpahs checks that we got all our formulas correctly and that the matrix mM is correct.

Table[
      Plot[{yy[t, k - 1], Transpose[mM][[k]] . XX[t]}, {t, -Pi, 
          2  Pi}, PlotStyle -> {{Thickness[0.012], 
              Green}, {Thickness[0.006], Red}}], {k, 1, 6}]

MatrixForm[Inverse[mM]]

Transpose[Inverse[mM]][[6]]

Transpose[Inverse[mM]][[6]] . YY[t]

The following table of varifications verifies that the inverse of mM does what it is supposed to do

Table[
      Simplify[xx[t, k - 1] == Transpose[Inverse[mM]][[k]] . 
            YY[t]], {k, 1, 6}]

The following table of graphs does the same thing with graphs.

Table[
      Plot[{xx[t, k - 1], Transpose[Inverse[mM]][[k]] . 
            YY[t]}, {t, -Pi, 2  Pi}, 
        PlotStyle -> {{Thickness[0.012], Green}, {Thickness[0.006], 
              Red}}, PlotRange -> {-1.2, 1.2}], {k, 1, 
        6}]