You are on page 1of 18

Goi lnh

. calculator.sty may tnh c`m tay trong TeX


,
Hu,u in
Nguyn
Khoa Toan - Co, - Tin hoc
.
HKHTN H`a Ni,
. HQGHN

Gio,i thiu
.

,
,
Goi lnh
. calculator th hin
. cac phep tnh cua may tnh c`m tay ba` ng cac lnh
. trong TeX.
http://www.ctan.org/tex-archive/macros/latex/contrib/calculator
,
Tac gia l`a Robert Fuster.

,
Su, dung
. goi lnh
.

Cac lnh
. tnh toan vit hoa v`a ghi v`ao mt
. bin.
,,
1. Cac lnh
. b`nh phuong, can chia, cng:
.

\SQUARE{2.5}{\tempA}
\SQUAREROOT{12}{\tempB}
2.52
6.25

\EXP{3.4}{\tempC}
+ e3.4 =
+ 29.96432
3.4641
12
\DIVIDE{\tempA}{\tempB}{\divisio}
= 1.80421 + 29.96432
\ADD{\divisio}{\tempC}{\sol}
= 31.76854
\begin{align*}
\frac{2.5^2}{\sqrt{12}}+\mathrm{e}^{3.4}
&= \frac{\tempA}{\tempB}+\tempC \\
&= \divisio+\tempC \\
&=\sol
\end{align*}
,
,
,
2. Lnh
. chu a bin giu kt qua cui c`ung

Hu,u i,n
http://nhdien.wordpress.com - Nguyn

,
,
,
,,
\SQUARE{5}\sol
Lnh
. \sol chu a kt qua b`nh phuong cua
L
sol}
5:
.nh \texttt{\textbackslash
,
,
,
,
,

ch
ua kt qua b`
nh phuong cua $5$:
52 = 25
\[5^2=\sol\]
,
,
Thay d
gio`, lai
i, lnh
. \sol by
. chu a can
\begin{center}
,
bc
. hai cua 5:
\SQUAREROOT{5}\sol
,

Thay i, l
.nh \verb!\sol!
,
,
,
5 = 2.23605
by gi`o l.
ai ch
ua cn b.
c hai cua $5$:
\[\sqrt{5}=\sol\]
\end{center}
3. Phep cng
.

1.256 + 3.214 = 4.47

\ADD{1.256}{3.214}{\sol}
$1.256+3.214=\sol$
4. Phep tru`,

\SUBTRACT{1.256}{3.214}{\sol}
$1.256-3.214=\sol$

1.256 3.214 = 1.95801

5. Phep nhn

7
\MULTIPLY{1.256}{3.214}{\sol}
$1.256\times3.214=\sol$

1.256 3.214 = 4.03677

6. Phep chia

1.256/3.214 = 0.39078

\DIVIDE{1.256}{3.214}{\sol}
$1.256/3.214=\sol$
7. Sao chep

-1.256

\COPY{-1.256}{\sol}
\sol
8. Phep ly max

7
\MAX{1.256}{3.214}{\sol}
\[\max(1.256,3.214)=\sol\]

2
max(1.256, 3.214) = 3.214

Hu,u i,n
http://nhdien.wordpress.com - Nguyn
9. Phep ly min

2
= 1.98134

\POWER{-1.256}{-5}{\sola}
\POWER{-1.256}{5}{\solb}
\POWER{-1.256}{0}{\solc}
\[
\begin{aligned}
(-1.256)^{-5}&=\sola\\
(-1.256)^{5}&=\solb\\
(-1.256)^{0}&=\solc
\end{aligned}
\]
14. Phep ly gia tri. tuyt
i
. d

= 1.57751

:
(1.256)3

\CUBE{-1.256}{\sol}
$(-1.256)^3=\sol$
13. Phep luy thu`,a

:
(1.256)2

\SQUARE{-1.256}{\sol}
$(-1.256)^2=\sol$
,,
12. Phep lp
. phuong

:
Mt
. inch ba` ng 2.54 cm.

\LENGTHDIVIDE{1in}{1cm}{\sol}
M
ng $\sol$ cm.
.t inch b`
11. Phep B`nh phu,o,ng

:
1.256

\MIN{1.256}{3.214}{\sol}
\sol
,
,
10. Phep d
i d. d`ai do
n vi.

(1.256)5 = 0.31989
(1.256)5 = 3.1256
(1.256)0 = 1

\ABSVALUE{-1.256}{\sol}
$\left\vert-1.256\right\vert=\sol$

|1.256| = 1.256

Hu,u i,n
http://nhdien.wordpress.com - Nguyn

15. Phep ly ph`n nguyn

,
\INTEGERPART{1.256}{\sola}
Ph`n nguyn cua 1.256 is 1, nhu,ng ph`n
,
\INTEGERPART{-1.256}{\solb}
nguyn cua 1.256 is 2.
,
`
Phn nguyn cua $1.256$ is $\sola$,
,
nhu,ng ph`n nguyn cua $-1.256$ is $\solb$.
16. Phep ly ph`n nguyn du,o,i

\FLOOR{1.256}{\sol}
,
Ph`n nguyn cua $1.256$ is $\sol$.

,
Ph`n nguyn cua 1.256 is 1.

17. Phep ph`n nguyn phn s

7
\FRACTIONALPART{1.256}{\sol} \sol\\
\FRACTIONALPART{-1.256}{\sol} \sol
18. Phep ly chu, s thp
. phn

\TRUNCATE[0]{1.25688}{\sol} \sol\\
\TRUNCATE[2]{1.25688}{\sol} \sol\\
\TRUNCATE[4]{1.25688}{\sol} \sol

8 :

0.256
0.744

8 :

1
1.25
1.2568

19. Phep l`am tr`on

7
\ROUND[0]{1.25688}{\sol} \sol\\
\ROUND[2]{1.25688}{\sol} \sol\\
\ROUND[4]{1.25688}{\sol} \sol

8 :

1
1.26
1.2569

20. Phep chia nguyn

7
\INTEGERDIVISION{435}{27}{\sola}{\solb}
$435=27\times\sola+\solb$
21. Phep chia

8 :

435 = 27 16 + 3

Hu,u i,n
http://nhdien.wordpress.com - Nguyn

7
\INTEGERDIVISION{27}{435}{\sola}{\solb}
$27=435\times\sola+\solb$
22. Phep chia

\INTEGERDIVISION{-435}{27}{\sola}{\solb}
$-435=27\times(\sola)+\solb$
23. Phep chia

\INTEGERDIVISION{435}{-27}{\sola}{\solb}
$435=-27\times(\sola)+\solb$
24. Phep chia

\INTEGERDIVISION{-435}{-27}{\sola}{\solb}
$-435=-27\times\sola+\solb$
25. Phep chia

\INTEGERQUOTIENT{435}{27}{\sol} \sol\\
\INTEGERQUOTIENT{27}{435}{\sol} \sol\\
\INTEGERQUOTIENT{-43.5}{2.7}{\sol} \sol
26. Phep ly m dun

\GCD{435}{27}{\sol}
$\gcd(435,27)=\sol$

8 :

8 :

8 :

8 :

27 = 435 0 + 27

435 = 27 (17) + 24

435 = 27 (16) + 3

435 = 27 17 + 24

16
0
-17

\MODULO{435}{27}{\sol}
\[ 435 \equiv \sol \pmod{27} \]
\MODULO{-435}{27}{\sol}
\[-435 \equiv \sol \pmod{27}\]
27. Phep Ly u,o,c s chung lo,n nht

8 :

2
435 3

(mod 27)

435 24 (mod 27)

:
gcd(435, 27) = 3

Hu,u i,n
http://nhdien.wordpress.com - Nguyn

,
28. Phep ly bi
. s chung lo n nht

8 :

lcm(435, 27) = 3915

\newcommand{\lcm}{\operatorname{lcm}}
\LCM{435}{27}{\sol}
$\lcm(435,27)=\sol$
,
29. Phep gian u,o,c phn s

8 :

435/27 = 145/9

\FRACTIONSIMPLIFY{435}{27}{\sola}{\solb}
$435/27=\sola/\solb$
30. Phep ly can

1.44 = 1.2

\SQUAREROOT{1.44}{\sol}
$\sqrt{1.44}=\sol$
31. Phep ly mu theo e

exp(0.5) = 1.64871

\EXP{0.5}{\sol}
$\exp(0.5)=\sol$
32. Phep mu co, s 10

:
101.3

\EXP[10]{1.3}{\sol}
$10^{1.3}=\sol$

2
= 19.95209

33. Phep mu co, s

21/3 = 1.25989

\EXP[2]{0.33333}{\sol}
$2^{1/3}=\sol$
34. Phep Logarit

7
\LOG{0.5}{\sol}
$\log 0.5=\sol$

log 0.5 = 0.69315

Hu,u i,n
http://nhdien.wordpress.com - Nguyn

35. Phep

\LOG[10]{0.5}{\sol}
$\log_{10} 0.5=\sol$
36. Phep

\DEGREESSIN{60}{\sol}
$\sin 60^{\textrm o}=\sol$
41. Phep

\DEGREESCOS{60}{\sol}
$\cos 60^{\textrm o}=\sol$
42. Phep

cot /3 = 0.57736

\COT{\numberTHIRDPI}{\sol}
$\cot \pi/3=\sol$
40. Phep

tan /3 = 1.73201

\TAN{\numberTHIRDPI}{\sol}
$\tan \pi/3=\sol$
39. Phep

:
cos /3 = 0.5

\COS{\numberTHIRDPI}{\sol}
$\cos \pi/3=\sol$
38. Phep

log10 0.5 = 0.30103

sin /3 = 0.86601

\SIN{\numberTHIRDPI}{\sol}
$\sin \pi/3=\sol$
37. Phep

sin 60o

2
= 0.86601

cos 60o

2
= 0.49998

Hu,u i,n
http://nhdien.wordpress.com - Nguyn

\DEGREESTAN{60}{\sol}
$\tan 60^{\textrm o}=\sol$

tan 60o

= 1.73201

43. Phep

\DEGREESCOT{60}{\sol}
$\cot 60^{\textrm o}=\sol$

cot 60o

= 0.57736

44. Phep

0.70709

\DEGREESCOS[400]{50}{\sol}
\sol
45. Phep

0.70709

\DEGREESCOS{45}{\sol}
\sol
46. Phep

0.7071

\COS{\numberQUARTERPI}{\sol}
\sol
47. Phep

0.70709

\DEGREESCOS[8]{1}{\sol}
\sol
48. Phep

7
\DEGtoRAD{60}{\sol}
\sol
49. Phep

:
1.0472

Hu,u i,n
http://nhdien.wordpress.com - Nguyn

8 :

\MULTIPLY{\numberTWOPI}{10}{\TWENTYPI}
\ADD{\numberPI}{\TWENTYPI}{\TWENTYONEPI}
\REDUCERADIANSANGLE{\TWENTYONEPI}{\sol}
\sol

3.14159

50. Phep

90

\REDUCEDEGREESANGLE{3690}{\sol}
\sol
51. Phep

1.61328

\SINH{1.256}{\sol}
\sol
52. Phep

1.89807

\COSH{1.256}{\sol}
\sol
53. Phep

0.84995

\TANH{1.256}{\sol}
\sol
54. Phep

1.17651

\COTH{1.256}{\sol}
\sol
55. Phep

7
\VECTORCOPY(1,-1)(\sola,\solb)
$(\sola,\solb)$

(1, 1)

Hu,u i,n
http://nhdien.wordpress.com - Nguyn

10

56. Phep

7
\VECTORCOPY(1,-1,2)(\sola,\solb,\solc)
$(\sola,\solb,\solc)$

8 :

8 :

8 :

8 :

(1, 1, 2)

57. Phep

\VECTORADD(1,-1,2)(3,5,-1)(\sola,\solb,\solc) (1, 1, 2) + (3, 5, 1) =


(4, 4, 1)
$(1,-1,2)+(3,5,-1)=(\sola,\solb,\solc)$

58. Phep

\VECTORSUB(1,-1,2)(3,5,-1)(\sola,\solb,\solc) (1, 1, 2) (3, 5, 1) =


(2, 6, 3)
$(1,-1,2)-(3,5,-1)=(\sola,\solb,\solc)$

59. Phep

7
\SCALARVECTORPRODUCT{2}(3,5)(\sola,\solb)
$2(3,5)=(\sola,\solb)$

2(3, 5) = (6, 10)

60. Phep

7
\SCALARVECTORPRODUCT{2}(3,5,-1)(%
\sola,\solb,\solc)
$2(3,5,-1)=(\sola,\solb,\solc)$

8 :

8 :

8 :

2(3, 5, 1) = (6, 10, 2)

61. Phep

7
\SCALARPRODUCT(1,-1)(3,5){\sol}
$(1,-1)\cdot(3,5)=\sol$

(1, 1) (3, 5) = 2

62. Phep

7
\SCALARPRODUCT(1,-1,2)(3,5,-1){\sol}
$(1,-1,2)\cdot(3,5,-1)=\sol$

(1, 1, 2) (3, 5, 1) = 4

Hu,u i,n
http://nhdien.wordpress.com - Nguyn

11

63. Phep

\VECTORNORM(3,4)\sol
$\left\|(3,4)\right\|=\sol$

k(3, 4)k = 5

64. Phep

7
\VECTORNORM(1,2,-2)\sol
$\left\|(1,2,-2)\right\|=\sol$

k(1, 2, 2)k = 3

65. Phep

7
\UNITVECTOR(3,4)(\sola,\solb)
$(\sola,\solb)$

(0.59999, 0.79999)

66. Phep

8 :

8 :

(0.33333, 0.66666, 0.66666)

\UNITVECTOR(1,2,-2)(\sola,\solb,\solc)
$(\sola,\solb,\solc)$
67. Phep

(3, 4)

\VECTORABSVALUE(3,-4)(\sola,\solb)
$(\sola,\solb)$
68. Phep

8 :

\VECTORABSVALUE(3,-4,-1)(\sola,\solb,\solc)
$(\sola,\solb,\solc)$
69. Phep

(3, 4, 1)

Hu,u i,n
http://nhdien.wordpress.com - Nguyn

12

1 1 2
3
0 5
1 1 4

\MATRIXCOPY(1, -1, 2;
3, 0, 5;
-1, 1, 4)%
(\sola,\solb,\solc;
\sold,\sole,\solf;
\solg,\solh,\soli)
$\begin{bmatrix}
\sola & \solb & \solc \\
\sold & \sole & \solf \\
\solg & \solh & \soli
\end{bmatrix}$
70. Phep

\TRANSPOSEMATRIX(1,-1;3,0)%
(\sola,\solb;\solc,\sold)
$\begin{bmatrix}
1 & -1 \\ 3 & 0
\end{bmatrix}^T=\begin{bmatrix}
\sola & \solb \\ \solc & \sold
\end{bmatrix}$

:

T 

1 1
1 3
=
3 0
1 0

71. Phep

7
\MATRIXADD(1,-1;3,0)(3,5;-3,2)%
(\sola,\solb;\solc,\sold)
$\begin{bmatrix}
1 & -1 \\ 3 & 0
\end{bmatrix}+
\begin{bmatrix}
3 & 5 \\ -3 & 2
\end{bmatrix}=\begin{bmatrix}
\sola & \solb \\ \solc & \sold
\end{bmatrix}$
72. Phep

:


2


 

1 1
3 5
4 4
+
=
3 0
3 2
0 2

Hu,u i,n
http://nhdien.wordpress.com - Nguyn

13

:


 

1 1
3 5
2 6

=
3 0
3 2
6 2

\MATRIXSUB(1,-1;3,0)(3,5;-3,2)%
(\sola,\solb;\solc,\sold)
$\begin{bmatrix}
1 & -1 \\ 3 & 0
\end{bmatrix}\begin{bmatrix}
3 & 5 \\ -3 & 2
\end{bmatrix}=\begin{bmatrix}
\sola & \solb \\ \solc & \sold
\end{bmatrix}$

73. Phep

1 1 2
3 3 6
\SCALARMATRIXPRODUCT{3}(1,-1,2;

0 5 = 9
0 15
3 3
3, 0,5;
1 1 4
3 3 12
-1, 1,4)%
(\sola,\solb,\solc;
\sold,\sole,\solf;
\solg,\solh,\soli)
$3\begin{bmatrix}
1 & -1 & 2 \\ 3 & 0 & 5 \\ -1 & 1 & 4
\end{bmatrix}
=\begin{bmatrix}
\sola & \solb & \solc \\
\sold & \sole & \solf \\
\solg & \solh & \soli
\end{bmatrix}$
74. Phep

Hu,u i,n
http://nhdien.wordpress.com - Nguyn

14

:


   
1 1 3
2
=
0 2
5
10

\MATRIXVECTORPRODUCT(1,-1;
0, 2)(3,5)(\sola,\solb)
$\begin{bmatrix}
1 & -1 \\ 0 & 2
\end{bmatrix}
\begin{bmatrix}
3 \\ 5
\end{bmatrix}
=\begin{bmatrix}
\sola \\ \solb
\end{bmatrix}$
75. Phep

\MATRIXPRODUCT(1,-1,2;3,0,5;-1,1,4)%
(3,5,-1;-3,2,-5;1,-2,3)%
(\sola,\solb,\solc;
\sold,\sole,\solf;
\solg,\solh,\soli)
\begin{multline*}
\begin{bmatrix}
1 & -1 & 2 \\ 3 & 0 & 5 \\ -1 & 1 &
\end{bmatrix}
\begin{bmatrix}
3 & 5 & -1 \\ -3 & 2 & -5 \\ 1 & -2
\end{bmatrix}\\
=\begin{bmatrix}
\sola & \solb & \solc \\
\sold & \sole & \solf \\
\solg & \solh & \soli
\end{bmatrix}
\end{multline*}

1 1 2
3
5 1
3
0 5 3 2 5
1 1 4
1 2 3

8 1 10
5 12
= 14
2 11 8
4

& 3

76. Phep

7
\DETERMINANT(1,-1,2;3,0,5;-1,1,4){\sol}
$\begin{vmatrix}
1 & -1 & 2 \\ 3 & 0 & 5 \\ -1 & 1 & 4
\end{vmatrix}=\sol$

8 :


1 1 2


3
0 5 = 18

1 1 4

Hu,u i,n
http://nhdien.wordpress.com - Nguyn

15

77. Phep

\INVERSEMATRIX(1,-1;3,5)(%
\sola,\solb;\solc,\sold)
$\begin{bmatrix}
1 & -1 \\ 3 & 5
\end{bmatrix}^{-1}=
\begin{bmatrix}
\sola & \solb \\ \solc & \sold
\end{bmatrix}$


1 

1 1
0.625 0.125
=
3 5
0.375 0.125

78. Phep

\MATRIXABSVALUE(1,-1,2;3,0,5;-1,1,4)% 1 1 2
3 0 5
(\sola,\solb,\solc;
1 1 4
\sold,\sole,\solf;
\solg,\solh,\soli)
$\begin{bmatrix}
\sola & \solb & \solc \\
\sold & \sole & \solf \\
\solg & \solh & \soli
\end{bmatrix}$
79. Phep

7
\SOLVELINEARSYSTEM(1,-1,2;3,0,5;-1,1,4)%
(-4,4,-2)%
(\sola,\solb,\solc)
,
Giai h.
phu,o,ng tr`
nh
\[
\begin{bmatrix}
1 & -1 & 2 \\ 3 & 0 & 5 \\ -1 & 1 & 4
\end{bmatrix}\mathsf{X}=\begin{bmatrix}
-4\\4\\-2
\end{bmatrix}
\]
ta nh.
n u,.
o,c
$\mathsf{X}=\begin{bmatrix}
\sola \\ \solb\\ \solc
\end{bmatrix}$

8 :

,
Giai h. phu,o,ng tr`nh


1 1 2
4
3
0 5 X = 4
1 1 4
2

3
,o,c X = 5
ta nhn
du

.
.
1

Hu,u i,n
http://nhdien.wordpress.com - Nguyn

80. Phep

16

\SQUAREfunction{3}{\sol}{\Dsol}
If
If $f(t)=t^2$, then
\[
f(3)=\sol \mbox{ and } f(3)=\Dsol
\]
81. Phep

82. Phep

\SCALEVARIABLEfunction
{-1}{\EXPfunction}
{\NEGEXPfunction}
\PRODUCTfunction
{\NEGEXPfunction}
{\COSfunction}
{\NEGEXPCOSfunction}
\LINEARCOMBINATIONfunction
{3}{\SQUAREfunction}
{-2}{\NEGEXPCOSfunction}
{\myfunction}
\myfunction{5}{\sol}{\Dsol}

f (t) = t 2 ,

then

f (3) = 9 and f 0 (3) = 6

:
x
1
2
3
4
5
6

$\begin{array}{cll}
x & \log x & \log x \\
\LOGfunction{1}{\logx}{\Dlogx}
1 &\logx & \Dlogx\\
\LOGfunction{2}{\logx}{\Dlogx}
2 &\logx & \Dlogx\\
\LOGfunction{3}{\logx}{\Dlogx}
3 &\logx & \Dlogx\\
\LOGfunction{4}{\logx}{\Dlogx}
4 &\logx & \Dlogx\\
\LOGfunction{5}{\logx}{\Dlogx}
5 &\logx & \Dlogx\\
\LOGfunction{6}{\logx}{\Dlogx}
6 &\logx & \Dlogx
\end{array}$

log x
0
0.69315
1.0986
1.38629
1.60942
1.79176

log x
1
0.5
0.33333
0.25
0.2
0.16666

Hu,u i,n
http://nhdien.wordpress.com - Nguyn

83. Phep

Nu
\[
f(t)=3t^2-2\mathrm{e}^{-t}\cos t
\]
th`

\[
\begin{gathered}
f(5)=\sol\\
f(5)=\Dsol
\end{gathered}
\]
84. Phep

:
Nu
f (t) = 3t 2 2et cost
th`
f (5) = 74.99619
f 0 (5) = 29.99084

\newcpoly{\mypoly}{1}{0}{-1}{1}
\mypoly{2}{\sol}{\Dsol}
$p(2)=\Dsol$
85. Phep

17

p0 (2) = 8

v
o,i h`
am s $f(t)=(t^2,t^3)$ ta c
o vo,i h`am s f (t) = (t 2 ,t 3 ) ta co
\VECTORfunction
{\SQUAREfunction}{\CUBEfunction}{\F}

Cac h`am s v`a ha` ng s


\numberPI
\numberTHREEHALFPI
\numberQUARTERPI
\numberSIXTHPI
\numberE
\numberETWO
\numberLOGTEN
\numberGOLD
\numberSQRTTWO
\numberSQRTFIVE
\numberCOSXXX

3.14159
4.71237 3/2
0.78539 /4
0.52359 /6
2.71828 e
7.38902 e2
2.30258 log 10
1.61803

1.41421 2
2.23607 5
0.86603 cos /6

\numberHALFPI
\numberTHIRDPI
\numberFIFTHPI
\numberTWOPI
\numberINVE
\numberINVETWO

1.57079 /2
1.0472 /3
0.62831 /5
6.28317 2
0.36787 1/e
0.13533 1/e2

\numberINVGOLD
\numberSQRTTHREE

0.61803 1/

1.73205 3

\numberCOSXLV

0.70711 cos /4

Hu,u i,n
http://nhdien.wordpress.com - Nguyn
\ZEROfunction
\IDENTITYfunction
\SQUAREfunction
\SQRTfunction
\EXPfunction
\COSfunction
\TANfunction
\COSHfunction
\TANHfunction
\HEAVISIDEfunction

f (t) = 0
f (t) = t
2
f (t) = t
f (t) = t
f (t) = expt
f (t) = cost
f (t) = tant
f (t) = cosht
f (t) = tanht
(
0 (t < 0)
f (t) =
1 (t 0)

18
\ONEfunction
\RECIPROCALfunction
\CUBEfunction

f (t) = 1
f (t) = 1/t
f (t) = t 3

\LOGfunction
\SINfunction
\COTfunction
\SINHfunction
\COTHfunction

f (t) = logt
f (t) = sint
f (t) = cott
f (t) = sinht
f (t) = cotht

You might also like