CU SEC-B-2.1 Scientific Computing with SageMath, 2025
University of Calcutta question paper, B.Sc. Honours Semester IV, 2025. Scientific Computing with SageMath. Typed in LaTeX, searchable, with a printable PDF.
Open this paper in MathQP
- What will be the output of the following Sage code? texttt exp(10//4) - e textasciicircum (10%4).n(digits = 2)
- Which SageMath function computes the numerical approximation of pi ?
- What is the result of texttt sum([k textasciicircum 2 for k in range(1, 6)]) ?
- Find the correct SageMath code that computes the second derivative of f(x) = x 3 sin (x) .
- What will be the output of the following Sage code? texttt steps = 10 texttt steps = 20 texttt steps /= 5 texttt print("steps =", steps)
- What will be the output of texttt ln(32) - log(32) ?
- Which of the following Sage codes gives the output x 2 + 2x + 1 = 0 ?
- What will be the output of the following Sage code? texttt for i in range(3): texttt for j in range(3): texttt if i == j: texttt print(i, j)
- What is the correct SageMath code to compute int limits 0 infty x e -x 2 ,dx ?
- Which SageMath command plots the polar curve r = 1 + cos ( theta ) in [0, 2 pi ] ? (Let texttt theta = var('theta’) .)
- Write Sage commands to compute left ( sqrt 2 + log (e 3) right ) 5 and simplify the result.
- Give the output of the Sage commands : texttt 10 textasciicircum (1/2) , texttt sin(60) .
- Explain how the number of digits in 22 22 can be evaluated using Sage commands.
- Write Sage commands to find the number of factors of 4321765 .
- Rewrite the Sage expression texttt (((2-4)*(4-3)+4) textasciicircum 10)/(2 textasciicircum 20) in three lines of code.
- Use Sage code to find the value of tan -1 sqrt 3 in radians.
- Find the number of digits of 2 2 100 using Sage code.
- Find the output of the Sage code : qmarks 3+2+3+2 texttt s = 0 texttt for i in range(1, 10): texttt if i % 2 == 0: texttt s = s + i textasciicircum 2 texttt print(s)
- Write Sage code to plot the graph of f(x) = x + e x for x in [-2, 2] , its tangent at x = 0 , and a big dot of size 40 at that point.
- Write Sage code to plot the parametric curve x = 2t y = 4t 2 , t in [1, 2] .
- Write Sage code to plot f(x) = dfrac 1 x 2 - 1 on [-3, 3] and its asymptotes, if any.
- Let f(x) = ln (x) . Write SageMath code to : (i) plot f(x) over x in [0.5, 4] , (ii) plot the tangent line to f(x) at x = 2 on the same graph, (iii) use a different colour for the tangent line.
- Write Sage code to plot r = 1 + 2 cos 3 theta on [0, 2 pi ] .
- Write Sage code to plot the piecewise function f(x) = 1 + x, -1 le x le 0 1 + x 3, 0 < x < 1.
- Write Sage code to find the second- and third-order derivatives of f(t) = sin (3 t) and plot them on the same graph.
- int s log s ,ds
- int limits 0 infty dfrac x 4 + 1 x 5 + 1 ,dx
- int limits -1 1 x 3 cos x ,dx .
- Write Sage code to find the second- and third-order derivatives of g(x) = e x 3 and plot them on the same graph.
- Define m(x) = dfrac 1 1 + x 2 in SageMath and write code to find int limits 0 1 m(x) ,dx .
- Use Sage code to evaluate int dfrac dx (3 + 5 cos x) 2 .
- Use SageMath to find the definite integral of g(x) = sin (x) from x = 0 to x = pi .
- Display A and B .
- Find A - B t and AB , if possible.
- Find det B and B -1 .
- Express A as a sum of a symmetric and a skew-symmetric matrix.
- Find the eigenvalues of A .
- Write SageMath code to display the 3 times 3 matrix A = 1 2 3 0 4 5 0 0 6 .
- Compute the transpose of A .
- Compute the determinant of A .
- Find the inverse of A .
- Compute the product A cdot A T ( A T = transpose of A ).
- Write Sage code to solve the differential equation dfrac dy dx + y = e x .
- Write Sage commands to solve the IVP dfrac dy dx = 1 + x log (x + 1) , y(0) = 1 .
- Write Sage code to solve the linear system 2x + y + 3z = 1 , 4x + 2y + 6z = 2 , x - y = 3 .
- Write Sage code to solve dfrac dy dx = dfrac 2x 3 - 1 x 2 + 1 + 2y tan (x) .
- Write Sage commands to solve the BVP dfrac d 2 y dx 2 - 3 dfrac dy dx + y = x 3 , y(0) = 1 , y(1) = 0 .
- Write Sage code to solve the nonlinear equation x 3 - 3 coth (x) + 9 log (x 2 + 1) = 10 .
- Write a Sage program to find sum limits n=1 100 dfrac n n + 1 .
- Without using inbuilt functions, write a program in Sage to find the primes between 100 and 500 .
- Write a program in Sage to find the greatest of three given integers a, b, c .
- Without using inbuilt functions, write a program in Sage to find the GCD of two given integers.
- Without using inbuilt functions, write a program in Sage to determine the factorial of 10 .
- Without using inbuilt functions, write a program in Sage to find the arithmetic mean and geometric mean of the given data: 12, 18, 25, 38, 42 .