Design and Evaluation of a Multilingual AI-based Mathematics Learning Assistant for Swahili, English, and Arabic
# Mathematics Assistant
A local multilingual math tutor that solves problems **step by step** in **Kiswahili**, **English**, and **Arabic**.
Built with **Python**, **Flask**, and **SymPy** — no API key required.
## Features
- Algebra, simultaneous equations, polynomials
- Differentiation and integration
- Sets, logic (truth tables)
- Coordinate geometry (distance, midpoint, slope, line, circle)
- Functions, trigonometry
- Linear programming (2 variables)
- Everyday word problems (sum/difference, percent, speed, age, cost)
- Multilingual UI with RTL support for Arabic
## Requirements
- Python 3.10+ (3.11 or 3.13 recommended)
- pip
## Setup
Open a terminal and go to the project folder:
```powershell
cd $HOME\Desktop\mathematics_assistant_app
```
Install dependencies:
```powershell
python -m pip install -r requirements.txt
```
## Run
Start the web app:
```powershell
python app.py
```
Then open your browser:
**
http://127.0.0.1:5001**
### How to use
1. Choose a language: **Kiswahili**, **English**, or **العربية**
2. Type a math problem (or click an example chip)
3. Click **Tatua / Solve / حلّ**
4. Read the numbered steps and final answer
Tip: press **Ctrl + Enter** to submit.
## Example problems
```text
2x - 1 = 5
2x + y = 5
x - y = 1
d/dx(x^3 + 2x)
integrate(x^2, (x, 0, 1))
{1,2,3} union {2,4}
truth table: p AND q
distance (0,0) and (3,4)
f(x)=x^2+1; f(3)
sin(pi/6)
maximize 3x+4y
x+y =0
y>=0
The sum of two numbers is 20 and the difference is 4
```
## Project structure
```text
mathematics_assistant_app/
├── app.py # Flask web server (port 5001)
├── solver.py # Core solver + translations
├── topics_extra.py # Sets, logic, geometry, trig, LP, word problems
├── linear_algebra.py # Matrices / vectors
├── requirements.txt
├── templates/index.html
└── static/
├── style.css
└── app.js
```
## Stop the server
In the terminal where the app is running, press **Ctrl + C**.
## Troubleshooting
| Problem | Fix |
|----- …