The Stack Overflow podcast is back! Listen to an interview with our new CEO.

# Questions tagged [functions]

Questions about the use of built-in Mathematica functions, including pure functions.

2,492 questions
Filter by
Sorted by
Tagged with
31 views

### What are equations on mathematica and differences between these errors?

These are the three errors I was given. I so far wrote the code which was computing the polynomial interpolation but now I am asked to find those three norms: norm error mean norm error maximal ...
32 views

### FindInstance confused by CoprimeQ

For some reason when I type FindInstance[a + b == c && CoprimeQ[a, b, c] == True, {a, b, c}, Integers] Mathematica just immediately returns my input as ...
19 views

### strange behaviour of Eigensystem and Eigenvectors [duplicate]

consider this: ...
70 views

### Quadratic form for specific formula as matrix reprezentation

So I have problem for specific formula to create Quadratic_form form from $$y = 3 + x_1 - 2 x_4 + 2 x_3 x_4 + x_2 (-x_3 + x_4)$$ as matrix \begin{bmatrix} 1 & 0 & 0 & 0 \\ ...
42 views

### Define a function including two solve solutions

I'm trying to combine the solutions coming from two NSolves and define a new function that I've to integrate. Basically I've defined two ...
36 views

### How to force Mathematica to give answer in certain functional form?

I want Mathematica to evaluate $$0=\psi (x) \left(\frac{k x^2}{2}-\text{En}\right)-\frac{\hbar ^2 \psi ''(x)}{2 m}$$ and give me answer in terms of the Hermite polynomials but it gives me result in ...
6k views

### How to create a rectangle wave (duty cycle $\ne$ 50 %)?

I'm trying to use phase-shifted SquareWave[] functions to create a rectangle wave: ...
59 views

### How to get ReplaceAll to happen before function call

I have a problem I am attempting to solve with NMinimize. I have a scoring function, which will give me a final score. The problem has many variables, so instead of having them as parameters, they ...
722 views

### Digital signal “square” wave function with finite rise time

Is there a built in function for a non-ideal square wave with finite rise and fall times to approximate digital signals? I know this should be possible with a piece-wise function but I though ...
12k views

### What are some useful, undocumented $\textit{Mathematica}$ functions?

There have already been some questions about some undocumented functionality in Mathematica. Such as (please add to these lists!) How can one find undocumented options or option values in Mathematica?...
34 views

### Contour Plot not taking previously defined expressions?

I am new to Mathematica so my question might sound a bit silly, but I hope you help me. While learning ContourPlot, I have learned that when I use the previously ...
78 views

### Creation of a Function

I am trying to create two functions but I am having trouble. The first consists of converting degrees Fahrenheit to Kelvin using this formula (F - 32)*(5/9) + 273 ...
86 views

### How to get the nth value of a function with arbitrary number of arguments

I know that I can define a function of a List and get the nth argument like: f[x_List]:=x[[1]]+x[[2]] What if the argument of ...
95 views

### Function value errors in NDSolveValue

I am solving a second order differential equation described by odey below. For the asymptotics, I have the following code which will be used as initial conditions for NDSolve. ...
94 views

### Automating a large operation by making a function

I would like to automate the following operation. To be transparent I shall put my code into separate chunks and explain the process. Suppose I have the following: ...
188 views

### The use of SlotSequence in If[#1 > #2, ##] &

The below function when applied to a list of two elements, will output the maximum between the two: If[#1 > #2, ##] & For example: ...
32 views

### Equation with infinitely many solutions [migrated]

Find all solutions to the equation sin(2x) cos(2x) = 1/2 that are in the interval [0,16]. Give all your answers as exact values, and state the number of solutions.
25 views

75 views

### NSolve not solving my transcendental equation

Would be grateful for your help in tackling this complex polynomial where I am trying to solve for x. When I run the code below, I get the message: value x of ...
113 views

### Best practice with Return in Module or Block

I am a bit confused on the use of Return in either Block or Module when defining a custom ...
162 views

### How to animate a function plot

How can I plot a function e.g. f[x_] := Sin[x], point by point (animation).