### Related

##### abs-cos-plot2d-sin

f(x):=cos(3*x)+sin(x)...

roots:[discrete,[[0.0...

P(x):=0.5258161777522...

Calculate

##### abs-cos-plot2d-sin

f(x):=cos(3*x)+sin(x)...

rootsL:[discrete,[[0....

L(x):=-0.014541721109...

Calculate

##### abs-cos-plot2d-sin

f(x):=cos(3*x)+sin(x)...

L(x):=-0.005196621394...

rootsL:[discrete,[[0....

Calculate

##### abs-cos-plot2d-sin

plot2d(%e^abs(x),[x,-...

plot2d((sin(x))^2+(co...

Calculate

##### abs-cos-plot2d-sin

f(x):=cos(3*x)+sin(x)...

roots:[discrete,[[0.0...

Appr(x):=+4.610238497...

Calculate

##### abs-cos-plot2d-sin

f(x):=cos(3*x)+sin(x)...

roots:[discrete,[[0.0...

P(x):=P(x):=0.5258161...

Calculate

##### abs-cos-plot2d-sin

f(x):=cos(3*x)+sin(x)...

roots:[discrete,[[0.1...

P(x):=-4.186736851777...

Calculate

##### abs-cos-plot2d-sin

f(x):=cos(3*x)+sin(x)...

roots:[discrete,[[0.0...

L(x):=-0.014541721109...

Calculate

##### abs-cos-plot2d-sin

f(x):=cos(3*x)+sin(x)...

rootsf:[discrete,[[0....

P0(x):=0.480834360338...

Calculate

##### abs-cos-plot2d-sin

plot2d(abs(sin(x))+ab...

Calculate

### [abs,cos,plot2d,sin]

Run Example
```(%i1)roots:[discrete,[[0.0319768834109988,1.0561528120730064],[0.283899459513814,1.1943168844243424],[0.7673353428448424,0.7170510066184492],[1.4431194332405084,1.916934614029138],[2.256503722739689,3.6888806977104367],[3.141592653589794,1.827433388230814],[4.026681584439897,3.7340981671538085],[4.840065873939079,2.9904656672276277],[5.515849964334744,3.6022745986162397],[5.999285847665773,5.777962364282578]]];
(%o1) [discrete, [[0.031976883410999, 1.056152812073006],
[0.28389945951381, 1.194316884424342], [0.76733534284484, 0.71705100661845],
[1.443119433240508, 1.916934614029138],
[2.256503722739689, 3.688880697710437],
[3.141592653589794, 1.827433388230814],
[4.026681584439897, 3.734098167153809],
[4.840065873939079, 2.990465667227628], [5.515849964334744, 3.60227459861624],
[5.999285847665773, 5.777962364282578]]]
(%i2) SqApp(x):=1.1480879375016593-1.3227575391863968*x+2.229829047566384*x^2-0.786569653679926*x^3+0.09721080122697817*x^4-0.003079572819004147*x^5;
(%o2) SqApp(x) := 1.148087937501659 - 1.322757539186397 x
2                         3                      4
+ 2.229829047566384 x  + (- 0.78656965367993) x  + 0.097210801226978 x
5
+ (- 0.0030795728190041) x
(%i3) f(x):=cos(3*x)+sin(x)+0.9*x;
(%o3)                  f(x) := cos(3 x) + sin(x) + 0.9 x
(%i4) plot2d([SqApp(x),f(x),roots],[x,0,2*%pi],[style,lines,lines,points],[legend,"SqAprx","f(x)",""]);
plotplot2d([abs(SqApp(x)-f(x))],[x,0,2*%pi],[style,lines],[legend,"|SqAprx(x) - f(x)|"]);
plot```
Run Example
```f(x):=cos(3*x)+sin(x)+0.9*x;
(%o1)                  f(x) := cos(3 x) + sin(x) + 0.9 x
(%i2) rootsL:[discrete,[[0.07876628689974075,1.1217856148304357],[0.6853966119230144,0.7832806054311361],[1.7785066862660024,3.1627422920513384],[3.141592653589793,1.8274333882308138],[4.504678620913584,3.6592857354288615],[5.597788695256573,3.9384732692798083]]];
(%o2) [discrete, [[0.078766286899741, 1.121785614830436],
[0.68539661192301, 0.78328060543114], [1.778506686266002, 3.162742292051338],
[3.141592653589793, 1.827433388230814],
[4.504678620913584, 3.659285735428862],
[5.597788695256573, 3.938473269279808]]]
(%i3) L(x):=-0.014541721109549509*(x-0.6853966119230144)*(x-1.7785066862660024)*(x-3.141592653589793)*(x-4.504678620913584)*(x-5.597788695256573)+0.02563253639888055*(x-0.07876628689974075)*(x-1.7785066862660024)*(x-3.141592653589793)*(x-4.504678620913584)*(x-5.597788695256573)-0.11993863332079314*(x-0.07876628689974075)*(x-0.6853966119230144)*(x-3.141592653589793)*(x-4.504678620913584)*(x-5.597788695256573)+0.05322879447244654*(x-0.07876628689974075)*(x-0.6853966119230144)*(x-1.7785066862660024)*(x-4.504678620913584)*(x-5.597788695256573)-0.053293151362323876*(x-0.07876628689974075)*(x-0.6853966119230144)*(x-1.7785066862660024)*(x-3.141592653589793)*(x-5.597788695256573)+0.014166549091995167*(x-0.07876628689974075)*(x-0.6853966119230144)*(x-1.7785066862660024)*(x-3.141592653589793)*(x-4.504678620913584);
(%o3) L(x) := (- 0.01454172110955) (x - 0.68539661192301)
(x - 1.778506686266002) (x - 3.141592653589793) (x - 4.504678620913584)
(x - 5.597788695256573) + 0.025632536398881 (x - 0.078766286899741)
(x - 1.778506686266002) (x - 3.141592653589793) (x - 4.504678620913584)
(x - 5.597788695256573) + (- 0.11993863332079) (x - 0.078766286899741)
(x - 0.68539661192301) (x - 3.141592653589793) (x - 4.504678620913584)
(x - 5.597788695256573) + 0.053228794472447 (x - 0.078766286899741)
(x - 0.68539661192301) (x - 1.778506686266002) (x - 4.504678620913584)
(x - 5.597788695256573) + (- 0.053293151362324) (x - 0.078766286899741)
(x - 0.68539661192301) (x - 1.778506686266002) (x - 3.141592653589793)
(x - 5.597788695256573) + 0.014166549091995 (x - 0.078766286899741)
(x - 0.68539661192301) (x - 1.778506686266002) (x - 3.141592653589793)
(x - 4.504678620913584)
(%i4) P(x):=1.0+0.21725674468057535*(x-0.0)+0.5106344493684205*(x-0.0)*(x-1.2566370614359172)-0.29757553781393353*(x-0.0)*(x-1.2566370614359172)*(x-2.5132741228718345)+0.0863461159481014*(x-0.0)*(x-1.2566370614359172)*(x-2.5132741228718345)*(x-3.7699111843077517)-0.005970529364341655*(x-0.0)*(x-1.2566370614359172)*(x-2.5132741228718345)*(x-3.7699111843077517)*(x-5.026548245743669);
(%o4) P(x) := 1.0 + 0.21725674468058 (x - 0.0)
+ 0.51063444936842 (x - 0.0) (x - 1.256637061435917)
+ (- 0.29757553781393) (x - 0.0) (x - 1.256637061435917)
(x - 2.513274122871835) + 0.086346115948101 (x - 0.0) (x - 1.256637061435917)
(x - 2.513274122871835) (x - 3.769911184307752)
+ (- 0.0059705293643417) (x - 0.0) (x - 1.256637061435917)
(x - 2.513274122871835) (x - 3.769911184307752) (x - 5.026548245743669)
(%i5) rootsP:[discrete,[[0.0,1.0],[1.2566370614359172,1.2730128772125315],[2.5132741228718345,3.1587489572520724],[3.7699111843077517,3.1141518079594506],[5.026548245743669,2.7638199104992016],[6.283185307179586,6.654866776461628]]];
(%o5) [discrete, [[0.0, 1.0], [1.256637061435917, 1.273012877212532],
[2.513274122871835, 3.158748957252072],
[3.769911184307752, 3.114151807959451],
[5.026548245743669, 2.763819910499202],
[6.283185307179586, 6.654866776461628]]]
(%i6) plot2d([f(x),L(x),P(x)],[x,0,2*%pi],[style,lines,lines,lines],[legend,"f(x)","L(x)","P(x)"]);
plotplot2d([abs(f(x)-L(x)),abs(f(x)-P(x))],[x,0,2*%pi],[legend,"|f(x) - L(x)|","|f(x) - P(x)|"]);
plotplot2d([f(x),P(x),rootsP],[x,0,2*%pi],[style,lines,lines,points],[legend,"f(x)","P(x)",""]);
plot```
Run Example
```f(x):=cos(3*x)+sin(x)+0.9*x;
(%o1)                  f(x) := cos(3 x) + sin(x) + 0.9 x
(%i2) P(x):=0.14091755906633896+1.6316616237158366*x+3.2864830089456394*x^2+0.4368779142116228*x^3;
2
(%o2) P(x) := 0.14091755906634 + 1.631661623715837 x + 3.286483008945639 x
3
+ 0.43687791421162 x
(%i3) roots:[discrete,[[0.23913950145036234,1.2055976757642863],[1.9393571938211007,3.572038829706613],[4.3438281133584855,3.870369071999815],[6.044045805729224,5.956279942400571]]];
(%o3) [discrete, [[0.23913950145036, 1.205597675764286],
[1.939357193821101, 3.572038829706613],
[4.343828113358486, 3.870369071999815],
[6.044045805729224, 5.956279942400571]]]
(%i4) plot2d([f(x),P(x),roots],[x,0,2*%pi],[style,lines,lines,points],[legend,"f(x)","P(x)",""]);
plotplot2d([abs(f(x)-P(x))],[x,0,2*%pi]);
plot```

Help for Abs

Help for Cos

Help for Plot2d

Help for Sin