0% found this document useful (0 votes)
39 views48 pages

Pooja 757

The document provides information about defining and plotting functions in Mathematica. It defines a function f(x) = x^2 + 2x - 4, plots this function over various intervals, and clears the function. It also plots other functions like sin, exp, and composite functions, and explores options for controlling plots.

Uploaded by

Pooja Gill
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
39 views48 pages

Pooja 757

The document provides information about defining and plotting functions in Mathematica. It defines a function f(x) = x^2 + 2x - 4, plots this function over various intervals, and clears the function. It also plots other functions like sin, exp, and composite functions, and explores options for controlling plots.

Uploaded by

Pooja Gill
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 48

Name - Pooja Gill

Roll no. - 757


CHAPTER- 3
Functions and their Graphs

◼ 3.1 Defining a function


A function is a rule that assigned to each input results exactly one output.

Follow these rules when defining a function


1 The name of the function such as f or inv should be a lowercase letter,
or a word that begins with a lowercase letter. This is because all built -
in functions such as Log and N begin with capital letters. If your
function begins with a lowercase letter, you will never accidentally
give it a name that already belongs to some built - in function.
2 The function argument in these examples x must be
followed by an underscore _ on the left side of the definition.
3 Use square brackets [] to enclose the function argument.

4 Use the colon - equal combination :=


to separate the left side of the definition from the right.

Clearing a Function:-
After completing all your work major work is to clear the function used. Since once done it is a good
habit to clear the function in mathematica.
In[1]:= ?f
Out[1]=

Symbol

Global`f

Full Name Global`f


2

In[2]:= f[x_] := x ^ 2 + 2 x - 4

In[3]:= Clear[f]

◼ 3.2 Plotting a Function


In[4]:= PlotSin[1 + Cos[x]], x, - 10, 10
Out[4]=

1.0

0.8

0.6

0.4

0.2

-10 -5 5 10

In[5]:= PlotSin[1.4 + Cos[x]], x, - 10, 10


Out[5]=

1.0

0.9

0.8

0.7

0.6

0.5

-10 -5 5 10
3

In[6]:= PlotSin[Pi / 2 + Cos[x]], x, - 10, 10


Out[6]=

1.0

0.9

0.8

0.7

0.6

-10 -5 5 10

In[7]:= PlotSin[2 + Cos[x]], x, - 10, 10


Out[7]=

1.0

0.8

0.6

0.4

0.2

-10 -5 5 10

In[8]:= PlotExp[x ^ 2], x, - 3, 3


Out[8]=
1200

1000

800

600

400

200

-3 -2 -1 1 2 3
4

In[18]:=

PlotExp[x ^ 2], x, - 3, 3, PlotRange → Full


Out[18]=

8000

6000

4000

2000

-3 -2 -1 1 2 3

In[12]:=

PlotExp[x ^ 2], x, - 3, 3, PlotRange → Full


Out[12]=

8000

6000

4000

2000

-3 -2 -1 1 2 3
5

In[30]:=

Plot100 Cos[x] + Exp[x ^ 2], {x, - 3, 3}, PlotRange → 0, 200


Out[30]=
200

150

100

50

-3 -2 -1 0 1 2 3

In[31]:=

Plotx ^ 2, x, - 3, 3, AspectRatio → 2


Out[31]=

-3 -2 -1 1 2 3
6

In[32]:=

Plotx + 1, x, - 3, 3


Out[32]=

-3 -2 -1 1 2 3

-1

-2

In[34]:=

Plotx ^ 2 + 1, x, - 3, 3, AxesOrigin → 0, 0


Out[34]=

10

-3 -2 -1 1 2 3

In[35]:=

Plotx ^ 2 + 1, x, - 3, 3, Mesh → All


Out[35]=

10

-3 -2 -1 1 2 3
7

In[36]:=

Plotx ^ 2 + 1, x, - 3, 3, PlotStyle → LighterGreen, 0.8


Out[36]=

10

-3 -2 -1 1 2 3

In[37]:=

Plotx ^ (1 / 3), x, - 8, 8


Out[37]=

2.0

1.5

1.0

0.5

-5 5

In[38]:=

Plotx ^ 2 + 1, x, - 3, 3, PlotStyle → DirectiveThick, Red, Dashed


Out[38]=

10

-3 -2 -1 1 2 3
8

In[39]:=

Plotx ^ (1 / 3), x, - 8, 8


Out[39]=

2.0

1.5

1.0

0.5

-5 5

In[48]:=

Clear[f];

f[x_] := x ^ 5 - 4 x ^ 2 + 1  (x - 1 / 2) Plotf[x], x, - 3, 3

In[50]:=

Plotf[x], x, - 10, 10


Out[50]=

1.0

0.5

-10 -5 5 10

-0.5

-1.0

In[51]:=

Clear[f];
In[52]:=

f[x_] := x ^ 5 - 4 x ^ 2 + 1  (x - 1 / 2)
9

In[53]:=

Plotf[x], x, - 3, 3


Out[53]=

80

60

40

20

-3 -2 -1 1 2 3

-20

In[54]:=

Plotf[x], x, - 10, 10


Out[54]=

10 000

8000

6000

4000

2000

-10 -5 5 10

In[57]:=

Plotf[x], x, - 1, 2, Exclusions → (1 / 2)


Out[57]=

10

-1.0 -0.5 0.5 1.0 1.5 2.0

-5

-10
10

In[58]:=

Clear[f];
In[59]:=

f[x_] := x ^ 2 - 2 x + 4
In[60]:=

Plotf[x], x, - 1, 3


Out[60]=

-1 1 2 3

In[61]:=

Plotf[x], x, 1.9, 2.1


Out[61]=

4.2

4.1

4.0

3.9

1.95 2.00 2.05 2.10


11

In[62]:=

Withd = 10 ^ (- 10), Plotf[x], x, 2 - d, 2 + d


Out[62]=

2 2 2 2

In[63]:=

Log[1]
Out[63]=

In[64]:=

Clear[f];
In[65]:=

f[x_] := x ^ 2 + 2 x - 4
In[66]:=

f[1]
Out[66]=

-1

In[67]:=

f[Pi]
Out[67]=

-4 + 2 π + π2

In[68]:=

inv[x_] := 1 / x
In[69]:=

inv[45]
Out[69]=
1
45
In[70]:=

g[x_] := N[inv[x]]
g[45]
Out[71]=

0.0222222

ln 12:-
12

In[73]:=

realPowerx_, p_ := Ifx < 0 && Elementp, Rationals, IfOddQ[Denominator[p]],

IfOddQ[Numerator[p]], - Power- x, p, Power- x, p, Powerx, p, Powerx, p

In[74]:=

PlotrealPowerx, 1 / 3, x, - 8, 8


Out[74]=

-5 5

-1

-2

In[75]:=

PlotrealPowerx, 2 / 3, x, - 8, 8


Out[75]=

-5 5

Alternate of Clear all command:


In[76]:=

a = 7; b = 6; c = 4;
a, b, c
Out[77]=

{7, 6, 4}

In[78]:=

ClearAll ;
13

In[79]:=

a, b, c
Out[79]=

{7, 6, 4}

Here clear all is not working so we will use another function;


In[80]:=

Clear["Global`*"]
In[81]:=

a, b, c
Out[81]=

{a, b, c}

Difference between Immediate and Delayed assignment


In[82]:=

x = RandomInteger[100];
In[83]:=

x, x, x
Out[83]=

{74, 74, 74}

In[84]:=

x := RandomInteger[100];
In[85]:=

x, x, x
Out[85]=

{70, 44, 11}


14

Directive Command
In[86]:=

Plot2 (x - 4) ^ 2 + 1, x, 3, 5, PlotStyle → DirectiveThick, Red, Dashed


Out[86]=

3.0

2.5

2.0

1.5

3.5 4.0 4.5 5.0

In[87]:=

Plot2 (x - 4) ^ 2 + 1, x, 3, 5, PlotStyle → DirectiveThick, Red, Dashing[Large]


Out[87]=

3.0

2.5

2.0

1.5

3.5 4.0 4.5 5.0


15

In[88]:=

Plot2 (x - 4) ^ 2 + 1, x, 3, 5, PlotStyle → DirectiveThick, Red, Dashing[Small]


Out[88]=

3.0

2.5

2.0

1.5

3.5 4.0 4.5 5.0

In[89]:=

= Plot2 (x - 4) ^ 2 + 1, x, 3, 5,

PlotStyle → DirectiveThick, Purple, Dashing0.08, 0.08

Syntax: " = Plot2 (x - 4) ^ 2 + 1, {x, 3, 5}, PlotStyle → Directive[Thick, Purple, Dashing[{0.08, 0.08}]]" is incomplete;
more input is needed.

How to remove axes


In[89]:=

Plot2 (x - 4) ^ 2 + 1, x, 3, 5, Axes → {False}


Out[89]=
16

In[90]:=

Plot2 (x - 4) ^ 2 + 1, x, 3, 5, Axes → False, True


Out[90]=

3.0

2.5

2.0

1.5

1.0

In[91]:=

Plot2 (x - 4) ^ 2 + 1, x, 3, 5, Axes → True, True


Out[91]=

3.0

2.5

2.0

1.5

3.5 4.0 4.5 5.0


17

Frame command
In[92]:=

Plot2 (x - 4) ^ 2 + 1, x, 3, 5, Frame → True


Out[92]=

3.0

2.5

2.0

1.5

1.0

3.0 3.5 4.0 4.5 5.0

In[93]:=

Plot2 (x - 4) ^ 2 + 1, x, 3, 5, Frame → True, False


Out[93]=

3.0 3.5 4.0 4.5 5.0


18

In[94]:=

Plot2 (x - 4) ^ 2 + 1, x, 3, 5, Frame → True, False, True, False


Out[94]=

3.0

2.5

2.0

1.5

1.0

3.0 3.5 4.0 4.5 5.0

How to place arrowheads on the axes


In[96]:=

PlotSin[x] ^ 2, x, 0, 2 Pi, AxesStyle → Arrowheads[0.05]


Out[96]=

0.8

0.6

0.4

0.2

1 2 3 4 5
19

In[98]:=

Plotx ^ 2 - 1, x, - 5, 5, AxesStyle → Arrowheads- 0.05, 0.05


Out[98]=

20

15

10

-4 -2 2 4

Gridlines
In[99]:=

PlotSin[x] ^ 2, x, 0, 2 Pi, GridLines → Automatic


Out[99]=

1.0

0.8

0.6

0.4

0.2

1 2 3 4 5 6
20

In[100]:=

PlotSin[x] ^ 2, x, 0, 2 Pi, GridLines → Automatic ,

GridLinesStyle → DirectiveThin, Gray, Dashed


Out[100]=

1.0

0.8

0.6

0.4

0.2

1 2 3 4 5 6

In[101]:=

PlotSin[x] ^ 2, x, 0, 2 Pi,

GridLines → Range0, 2 Pi, Pi / 8, Range0, 1, 0.1, GridLinesStyle → Lighter[Gray]


Out[101]=

1.0

0.8

0.6

0.4

0.2

1 2 3 4 5 6
21

In[104]:=

PlotSin[x] ^ 2, x, 0, 2 Pi, GridLines → Range0, 2 Pi, Pi / 8, Range0, 1, 0.1,

GridLinesStyle → Lighter[Gray], Ticks → Range0, 2 Pi, Pi / 2, Automatic


Out[104]=

1.0

0.8

0.6

0.4

0.2

π 3π
0 π 2π
2 2

In[105]:=

PlotSin[x] ^ 2, x, 0, 2 Pi, GridLines → Range0, 2 Pi, Pi / 8, Range0, 1, 0.1,

GridLinesStyle → Lighter[Gray], Ticks → Range0, 2 Pi, Pi / 8, Automatic


Out[105]=

1.0

0.8

0.6

0.4

0.2

π π 3π π 5π 3π 7π 9 π 5 π 11 π 3 π 13 π 7 π 15 π
0 π 2π
8 4 8 2 8 4 8 8 4 8 2 8 4 8
22

In[106]:=

PlotSin[x] ^ 2, x, 0, 2 Pi, GridLines → Range0, 2 Pi, Pi / 8, Range0, 1, 0.1,

GridLinesStyle → DirectiveThick, Red, Dashed,

Ticks → Range0, 2 Pi, Pi / 8, Automatic


Out[106]=

1.0

0.8

0.6

0.4

0.2

π π 3π π 5π 3π 7π 9 π 5 π 11 π 3 π 13 π 7 π 15 π
0 π 2π
8 4 8 2 8 4 8 8 4 8 2 8 4 8

How to add lables:-


In[107]:=

PlotSin[x] ^ 2, x, 0, 2 Pi, Ticks → 0, Pi, 2 Pi, 0, .5, 1,

AxesLabel → x, Sin[x] ^ 2, PlotLabel → Sin[x] ^ 2


Out[107]=

sin2 (x)
sin2 (x)

0.5

x
π 2π
23

In[108]:=

PlotSin[x] ^ 2, x, 0, 2 Pi, Ticks → 0, Pi, 2 Pi, 0, .5, 1,

AxesLabel → x, Sin[x] ^ 2, PlotLabel → "y= (sin[x])^2"


Out[108]=

y= (sin[x])^2
sin2 (x)

0.5

x
π 2π

In[109]:=

p = PlotSin[x] ^ 2, x, 0, 2 Pi, Ticks → 0, Pi, 2 Pi, 0, .5, 1, AxesLabel → x, y;

Labeledp, Text"y= [sin(x)]^2", Right


Out[109]=
y

0.5
y= [sin(x)]^2

x
π 2π
24

Exclusions and vertical asymptotes:-


In[110]:=

Plot(x - 3) (x - 4)  (x - 2) (x - 5), x, 0, 7


Out[110]=

1 2 3 4 5 6 7

-2

-4

In[111]:=

Plot(x - 3) (x - 4)  (x - 2) (x - 5), x, 0, 7,

Exclusions → x ⩵ 2, x ⩵ 5, ExclusionsStyle → Dashed


Out[111]=

1 2 3 4 5 6 7

-2

-4
25

In[113]:=

PlotTan[x], x, 0, 4 Pi, Exclusions → Cos[x] ⩵ 0,

ExclusionsStyle → DirectiveGreen, Dashed,

Ticks → Range0, 4 Pi, Pi / 2, Automatic


Out[113]=

π 3π 5π 7π
π 2π 3π 4π
-2 2 2 2 2

-4

-6

Exercise 3.3
1. Use the gridlines and Tricks options,as well as the setting gridlinesStyle-> lighter gray to produce the
following Plot of the sign function.
In[114]:=

PlotSin[x], x, - 2 Pi, 2 Pi, GridLines → Range- 2 Pi, 2 Pi, Pi / 4, Range- 1, 1, 0.2,

GridLinesStyle → Lighter[Gray],
Ticks → 0, Pi, 2 Pi, - Pi, 2 Pi, 0, 0.5, 1, - 0.5, 1
Out[114]=

0.5

-π π 2π

-0.5

2. Use the Axes, Frame ,or the above function to produce a graph mentioned in the book of reference
26

In[128]:=

PlotCos15 x  (1 + x ^ 2), {x, - 3.5, 3.5}, Axes → True, False,

Frame → True, False, True, False, Filling → Axis, PlotRange → Full,

FrameStyle → DirectiveGray, 9, AspectRatio → Automatic

Plot: Options expected (instead of Filling → Axis) beyond position 2 in


Cos15 x
Plot , {x, -3.5, 3.5}, Axes → {True, False}, Frame → {{True, False}, {True, False}}, Filling → Axis,
1 + x2
PlotRange → Full, FrameStyle → Directive[Gray, 9], AspectRatio → Automatic. An option must
be a rule or a list of rules.
Out[128]=

Cos15 x
Plot , {x, - 3.5, 3.5}, Axes → {True, False},
1 + x2
Frame → {{True, False}, {True, False}}, Filling → Axis, PlotRange → Full,
FrameStyle → Directive[Gray, 9], AspectRatio → Automatic

3. Plot the function referenced in the book


In[121]:=

Plotx ^ 2, x, - 2, 2, Exclusions → {x ⩵ 1}, ExclusionsStyle → DirectiveWhite, Dashed


Out[121]=

-2 -1 1 2
27

Investigating Functions with Manipulations:-


In[129]:=

Manipulatex ^ 2, x, 1, 10


Out[129]=

In[130]:=

Manipulatex ^ 2, x, 0, 50, 5


Out[130]=

In[131]:=

ManipulatePlotx Sin[1 / x], x, 0, r, r, 0.1, 2


Out[131]=

0.05

0.02 0.04 0.06 0.08 0.10

-0.05

-0.10
28

In[132]:=

ManipulatePlotx Sin[1 / x], x, 0, r, r, 0.4, "Maximum value of x", 10 ^ (- 10), 2
Out[132]=

Maximum value of x

0.8

0.6

0.4

0.2

0.2 0.4 0.6 0.8 1.0 1.2

-0.2
29

In[134]:=

ManipulatePlotx Sin[x], x, - 10, 10,

PlotStyle → DirectiveThickness[t], Dashing[{d}], BlendRed, Blue, b,

t, .01, "Thickness ", .001, .02, d, 0.02, "dash size", 0, 0.04,

b, .5, "percent blue", 0, 1


Out[134]=

Thickness

dash size

percent blue

-10 -5 5 10

-2

-4

-6
30

In[135]:=

ManipulatePlota (x - b) ^ 2 + c, x, - 5, 5, PlotRange → 5, PlotLabel → "y=a(x-b)^2+c",

a, - 1, 1, {b, - 1}, - 3, 3, c, 2, - 2, 2


Out[135]=

y=a(x-b)^2+c

-4 -2 2 4

-2

-4
31

In[136]:=

ManipulatePlota (x - b) ^ 2 + c, x, - 5, 5, PlotRange → - 5, 4,

PlotLabel → "y=a(x-b)^2+c", a, - 1, 1, {b, - 1}, - 3, 3, c, 2, - 2, 2
Out[136]=

y=a(x-b)^2+c
4

-4 -2 2 4

-2

-4
32

In[137]:=

ManipulatePlota (x - b) ^ 2 + c, x, - 5, 5, PlotRange → - 5, 4,

PlotLabel → "y=a(x-b)^2+c", a, - 1, 1, {b, - 1}, - 3, 3, c, 2, - 2, 2
Out[137]=

y=a(x-b)^2+c
4

-4 -2 2 4

-2

-4
33

In[138]:=

ManipulatePlota (x - b) ^ 2 + c, x, - 5, 5, PlotRange → Full,

PlotLabel → "y=a(x-b)^2+c", a, - 1, 1, {b, - 1}, - 3, 3, c, 2, - 2, 2
Out[138]=

y=a(x-b)^2+c

-4 -2 2 4

-5

-10

-15

-20

-25

-30

-35
34

In[139]:=

ManipulatePlota (x - b) ^ 2 + c, x, - 5, 5, PlotRange → - 5, 4, - 2, 2,

PlotLabel → "y=a(x-b)^2+c", a, - 1, 1, {b, - 1}, - 3, 3, c, 2, - 2, 2
Out[139]=

y=a(x-b)^2+c
2

-4 -2 2 4

-1

-2
35

In[140]:=

ManipulatePlota (x - b) ^ 2 + c, x, - 5, 5, PlotRange → - 6, 6, - 7, 7,

PlotLabel → "y=a(x-b)^2+c", a, - 1, 1, {b, - 1}, - 3, 3, c, 2, - 2, 2
Out[140]=

y=a(x-b)^2+c

-6 -4 -2 2 4 6

-2

-4

-6
36

In[142]:=

ManipulatePlotSin[4 / x], x, - 2 Pi, 2 Pi, PlotPoints → pp,

MaxRecursion → mr, Mesh → m, pp, 64, "plot points", 4, 8, 16, 32, 64,

mr, 4, "MaxRecursion ", 0, 1, 2, 3, 4, m, Full, "Mesh", Full, Al, None
Out[142]=

plot points 4 8 1 3 6
6 2 4
MaxRecursion 0 1 2 3 4

Mesh Full Al None

1.0

0.5

-6 -4 -2 2 4 6

-0.5

-1.0
37

Settler Bar
In[143]:=

Manipulate

Plotf[x], x, 0, 4 Pi, Ticks → Range0, 4 Pi, Pi / 2, Automatic, PlotLabel → f[x],

f, Tan, "functions ", Cos, Sin, Sec, Csc, Tan, Cot, ControlType → SetterBar
Out[143]=

functions Cos Sin S C Tan Cot


e sc

tan(x)

π 3π 5π 7π
π 2π 3π 4π
-2 2 2 2 2

-4

-6
38

In[144]:=

ManipulatePlotx Sin[x], x, - 20, 20, AxesOrigin → pt, PlotRange → 20,

pt, 0, 0, "Move the axes: ", {- 20, - 20}, 20, 20, ControlPlacement → Left
Out[144]=

20

Move the axes:

10

-20 -10 10 20

-10

-20

In[145]:=

ManipulatePlotx Sin[x], x, - 20, 20, AxesOrigin → pt, PlotRange → 20,

pt, 0, 0, Locator


Out[145]=

20

10

-20 -10 10 20

-10

-20
39

In[146]:=

ManipulatePlot(Sin[x])  x, x, 0, 20, PlotStyle → color, color, Blue


Out[146]=

color

0.4

0.3

0.2

0.1

5 10 15 20

-0.1

-0.2

Dynamic Style
In[147]:=

Animatex ^ 2, x, 1, 10


Out[147]=

85.2852
40

In[148]:=

AnimatePlotx Sin[1 / x], x, 0, r, r, 0.1, 2


Out[148]=

0.8

0.6

0.4

0.2

0.2 0.4 0.6 0.8

-0.2

In[150]:=

OpenerView

Style"click the triangle ", "Text", Style"haha, you did it!", "Section "
Out[150]=

click the triangle


Out[149]=

click the triangle


In[151]:=

ListAnimate

Style"click the triangle ", "Text", Style"haha, you did it!", "Section "
Out[151]=

click the triangle

In[152]:=

FlipView

Style"click the triangle ", "Text", Style"haha, you did it!", "Section "
Out[152]=

click the triangle


41

In[154]:=

SlideView

Style"click the triangle ", "Text", Style"haha, you did it!", "Section "
Out[154]=

 ◂ ▸ 
click the triangle

Out[153]=

 ◂ ▸ 
click the triangle

In[155]:=

TabView"sine" → PlotSin[x], x, 0, 2 Pi, "cosine" → PlotCos[x], x, 0, 2 Pi


Out[155]=

1 2

1.0
0.5
sine →
-0.5 1 2 3 4 5 6
-1.0

In[157]:=

MenuView"sine" → PlotSin[x], x, 0, 2 Pi, "cosine" → PlotCos[x], x, 0, 2 Pi,

ImageSize → Automatic 0
Out[157]=

0
Out[156]=

Exercise 3.4
1. The following simple Manipulate has two
sliders : one for x and one for y. Make a Manipulate that also has output {x, y},
but that has a single Slider2D controller.
42

In[159]:=

ManipulatePlotx, y, x, 0, 1, AxesOrigin → pt, PlotRange → 0, 1,

pt, 0, 0, "Move the axes: ", 0, 0, 1, 1, ControlPlacement → Left
Out[159]=

1.0

Move the axes:


0.8

0.6

0.4

0.2

0.0 0.2 0.4 0.6 0.8 1.0

Out[158]=

1.0

Move the axes:


0.8

0.6

0.4

0.2

0.0 0.2 0.4 0.6 0.8 1.0


43

In[161]:=

ManipulatePlotx, y, x, 0, 1, AxesOrigin → pt, PlotRange → 0, 1,

pt, 0, 0, Locator


Out[161]=

1.0

0.8

0.6

0.4

0.2

0.0 0.2 0.4 0.6 0.8 1.0

Out[160]=

1.0

0.8

0.6

0.4

0.2

0.0 0.2 0.4 0.6 0.8 1.0

2. Make a Manipulate of a Plot where the user can adjust the AspectRatio in real time,
from a starting value of 1  5 five times as wide as it is tall to

an ending value of 5 five times as tall as it is wide. Set ImageSize

to Automatic, 128 so the height remains constant as the slider is moved.


44

In[164]:=

ManipulatePlotSin[x], x, - 2 Pi, 2 Pi, AspectRatio → ar,

PlotRange → - 2 Pi, 2 Pi, ImageSize → Automatic , 128,

ar, 1 / 5, "Adjust the aspect ratio", 1 / 5, 5, ControlPlacement → Left


Out[164]=

Adjust the aspect ratio

-6 -4 -2

◼ 3.5 Producing a Table of values


In[165]:=

f[x_] := x ^ 2
Tablef[x], x, 1, 10
Out[166]=

{1, 4, 9, 16, 25, 36, 49, 64, 81, 100}

In[168]:=

Tablef[x], x, 10


Out[168]=

{1, 4, 9, 16, 25, 36, 49, 64, 81, 100}


Out[167]=

{1, 4, 9, 16, 25, 36, 49, 64, 81, 100}

In[169]:=

Tablef[x], 10
Out[169]=

{1849, 4225, 3249, 9025, 5625, 5776, 1, 8281, 1849, 1024}

In[170]:=

Tablef[x], x, 1, 10, 2


Out[170]=

{1, 9, 25, 49, 81}

In[171]:=

Tablef[x], x, 1, 7, 12, 20


Out[171]=

{1, 49, 144, 400}


45

In[172]:=

data = Tablex, f[x], x, 10


Out[172]=

{{1, 1}, {2, 4}, {3, 9}, {4, 16}, {5, 25}, {6, 36}, {7, 49}, {8, 64}, {9, 81}, {10, 100}}

In[176]:=

Grid[data]
Out[176]=
1 1
2 4
3 9
4 16
5 25
6 36
7 49
8 64
9 81
10 100
Out[173]=
1 1
2 4
3 9
4 16
5 25
6 36
7 49
8 64
9 81
10 100

In[179]:=

Text @ Grid[data, Alignment → Right]


Out[179]=

1 1
2 4
3 9
4 16
5 25
6 36
7 49
8 64
9 81
10 100

In[175]:=

tablecontents = Prependdata, "x", "x^2"


Out[175]=

{{x, x^2}, {1, 1}, {2, 4}, {3, 9}, {4, 16}, {5, 25}, {6, 36}, {7, 49}, {8, 64}, {9, 81}, {10, 100}}
46

In[177]:=

Grid[tablecontents]
Out[177]=
x x^2
1 1
2 4
3 9
4 16
5 25
6 36
7 49
8 64
9 81
10 100

In[182]:=

Text @ Gridtablecontents, Alignment → Right,

Dividers → Center, False, True, Spacings → 2


Out[182]=

Grid[{{x, x^2}, {1, 1}, {2, 4}, {3, 9}, {4, 16}, {5, 25}, {6, 36}, {7, 49}, {8, 64}, {9, 81}, {10, 100}},
Alignment → Right, Dividers → {Center, {False, True}}, Spacings → 2]

Text @ Gridtablecontents, Alignment → Right,

Dividers → Right, False, True, Spacings → 2


Out[183]=

x x^2
1 1
2 4
3 9
4 16
5 25
6 36
7 49
8 64
9 81
10 100

In[7]:= Text @ Grid[tablecontents, Alignment → Right,


Dividers → {Right, {False, True}}, Spacings → 2]
Out[7]=

Grid[tablecontents, Alignment → Right, Dividers → {Right, {False, True}}, Spacings → 2]


47

In[53]:=

Text @ Gridtablecontents , Alignment → Right,

Dividers → Right, False, True, Spacings → 2


Out[55]=

Grid[tablecontents, Alignment → Right, Dividers → {Right, {False, True}}, Spacings → 2]


Out[54]=

Grid[tablecontents, Alignment → Right, Dividers → {Right, {False, True}}, Spacings → 2]


Out[53]=

Grid[tablecontents, Alignment → Right, Dividers → {Right, {False, True}}, Spacings → 2]


Out[52]=

Grid[tablecontents, Alignment → Right, Dividers → {Right, {False, True}}, Spacings → 2]

In[8]:= Text @ Gridtablecontents , Alignment → Right,

Dividers → Center, True, True, True, Spacings → 3


Out[8]=

Grid[tablecontents, Alignment → Right, Dividers → {Center, {True, True, True}}, Spacings → 3]

In[13]:=

Text @ Grid[tablecontents, Alignment → Right, Dividers → All, Spacings → 2]


Out[13]=

Grid[tablecontents, Alignment → Right, Dividers → All, Spacings → 2]

In[20]:=

Text @ Griddata, Alignment → Right, Dividers → All, Spacings → 2


Out[20]=

Grid[{{1, f[1]}, {10, f[10]}, {100, f[100]}, {1000, f[1000]}, {10 000, f[10 000]}, {100 000, f[100 000]}},
Alignment → Right, Dividers → All, Spacings → 2]

In[56]:=

Text @ Griddata, Alignment → Right, Dividers → All, Spacings → 2


Out[56]=

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
21 22 23 24 25 26 27 28 29 30 31 32 33 34 35
41 42 43 44 45 46 47 48 49 50 51 52 53 54 55
61 62 63 64 65 66 67 68 69 70 71 72 73 74 75
81 82 83 84 85 86 87 88 89 90 91 92 93 94 95

REFRENCE :-
48

Torrence and Torrenc

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy