From a0748ea6490cc635d6c843679bffdb4aaf75e825 Mon Sep 17 00:00:00 2001
From: Chris Sangwin
Date: Thu, 5 Feb 2026 13:46:24 +0000
Subject: [PATCH] Add additional question to the API demo site.
---
.../stackdemo/35_odd_even_functions.xml | 437 ++++++++++++++++++
1 file changed, 437 insertions(+)
create mode 100644 samplequestions/stackdemo/35_odd_even_functions.xml
diff --git a/samplequestions/stackdemo/35_odd_even_functions.xml b/samplequestions/stackdemo/35_odd_even_functions.xml
new file mode 100644
index 00000000000..74f6f710282
--- /dev/null
+++ b/samplequestions/stackdemo/35_odd_even_functions.xml
@@ -0,0 +1,437 @@
+
+
+
+
+
+ Odd and even functions
+
+
+ 1. Give an example of an odd function by typing an expression which represents it. \(f_1(x)=\) [[input:ans1]]. [[validation:ans1]] [[feedback:odd]]
+
2. Give an example of an even function. \(f_2(x)=\) [[input:ans2]]. [[validation:ans2]] [[feedback:even]]
+
3. Give an example of a function which is odd and even. \(f_3(x)=\) [[input:ans3]]. [[validation:ans3]] [[feedback:oddeven]]
+
[[feedback:poly]]
+
4. Is the answer to 3. unique? [[input:ans4]] (Or are there many different possibilities.) [[validation:ans4]] [[feedback:unique]]
]]>
+
+
+ A function \(f\) is odd if
+\[ f(x)=-f(-x) \forall x.\]
+An example is \(f(x)=4x^3\). Indeed, polynomials with only odd powers are fine.
+
A function \(f\) is even if \[ f(x)=f(-x) \forall x.\]
+An example is \(f(x)=5x^4\). Indeed, polynomials with only even powers are fine.
+
It is possible to have both \[ f(x)=f(-x)=-f(-x) \] in which case \(f(x)=0\) for all \(x\). This example is unique.
+